-
-
Save anonymous/d67cb717321cf3a0eca7 to your computer and use it in GitHub Desktop.
Mutliple rescue/retry
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
class MyClass | |
begin | |
rescue API::AuthorizationError => e | |
api_authorize | |
retry | |
def api_authorize | |
#do login things here, set a global containing a session | |
end | |
def initialize | |
api_authorize | |
end | |
def do_things_with_api | |
#stuff | |
end | |
end | |
end | |
##Burning question: will the "rescue" block with a 'retry' set cause do_things_with_api to re-execute? | |
#Or do I need to add this handler inside do_things_with_api? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment