-
-
Save anonymous/631e990ea2bea05655304465f58ba05e to your computer and use it in GitHub Desktop.
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
def get_from_api | |
raise 'service unavailable' | |
end | |
def get_from_db | |
'foo' | |
end | |
def get_the_thing | |
begin | |
get_from_api | |
rescue | |
get_from_db | |
end | |
end | |
get_the_thing | |
# "foo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment