Skip to content

Instantly share code, notes, and snippets.

@jspahrsummers
Created August 8, 2016 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jspahrsummers/4482c1649cfef543c4a7b92d9881e74f to your computer and use it in GitHub Desktop.
Save jspahrsummers/4482c1649cfef543c4a7b92d9881e74f to your computer and use it in GitHub Desktop.
An unexpected error has occurred.
do {
try myFunctionWhichOnlyThrowsOneErrorType()
} catch let err as ThatOneErrorType {
handleAppropriately()
} catch let err {
preconditionFailure("Unexpected error: \(err)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment