-
-
Save jordanorelli/468bc39552a4366f9de2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
begin | |
response = call_api # this might throw X | |
response.save_to_db # this might throw Y | |
rescue X | |
# handle the error with calling the api | |
rescue Y | |
# handle the error with saving to the database | |
rescue Exception => e | |
# handles *any* exception; maybe you got the exception type wrong? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment