XCTestCase extension to catch exceptions