Created
April 19, 2015 08:26
-
-
Save rebyn/db783ab060a072d25249 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
# Before | |
def self.send_request_to_path(request) | |
request.execute(target_base_url) | |
rescue Intercom::ServiceUnavailableError => e | |
if endpoints.length > 1 | |
retry_on_alternative_endpoint(request) | |
else | |
raise e | |
end | |
end | |
# After | |
def self.send_request_to_path(request) | |
request.execute(target_base_url) | |
rescue Intercom::ServiceUnavailableError | |
raise unless endpoints.length > 1 | |
retry_on_alternative_endpoint(request) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍 for refactored version.