Skip to content

Instantly share code, notes, and snippets.

@mahmudahsan
Created December 22, 2017 16:41
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 mahmudahsan/a9fc7af5a5bdd760233146ea136300df to your computer and use it in GitHub Desktop.
Save mahmudahsan/a9fc7af5a5bdd760233146ea136300df to your computer and use it in GitHub Desktop.
Error handling in swift
do {
try sampleThrowError()
}
catch SampleError.sample1 {
print("Sample 1 Error caught")
}
catch {
print("For all other cases")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment