Skip to content

Instantly share code, notes, and snippets.

@Anton3
Created December 20, 2015 08:36
Show Gist options
  • Save Anton3/47132957feed01828e13 to your computer and use it in GitHub Desktop.
Save Anton3/47132957feed01828e13 to your computer and use it in GitHub Desktop.
func f() throws Error1 { return 42 }
func g(meaning: Int) throws Error2 { print(meaning) }
func test() {
do {
try g(try f())
} catch let err1 as Error1 {
print("Error1")
} catch let err2 as Error2 {
print("Error2")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment