Catch exceptions during test execution