Created
December 22, 2017 16:41
-
-
Save mahmudahsan/a9fc7af5a5bdd760233146ea136300df to your computer and use it in GitHub Desktop.
Error handling in swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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