enum MyError: Error { case failureA case failureB } func produceFailure() throws(MyError) -> Int { throw .failureB } func anotherFunction() { do throws(MyError) { let result = try produceFailure() // `- error: errors thrown from here are not handled because the enclosing catch is not exhaustive print("Result:", result) } catch MyError.failureA { print("Failure A") } catch MyError.failureB { print("Failure B") } } anotherFunction()