RosettaCodeData/Task/Exceptions/Swift/exceptions-3.swift

8 lines
159 B
Swift
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
do {
try foo()
} catch MyException.TerribleException { // this can be any pattern
//Catch a specific case of exception
} catch {
//Catch any exception
}