Created
September 20, 2017 10:58
-
-
Save tijmenb/74b4bd02d8332cf58d82b1f71458a111 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
# In the app we re-raise every error, with a reference to the original | |
class HardWorker | |
def perform | |
# blabla | |
rescue GdsApi::TimeOut => e | |
raise GovukSidekiq::RetryableError.new(cause: e) | |
end | |
end | |
# In govuk_app_config we ignore all retryable errors | |
Raven.configure do |config| | |
config.excluded_exceptions << "GovukSidekiq::RetryableError" | |
end | |
# And in govuk_sidekiq we make sure that we raise the original error | |
sidekiq_retries_exhausted do |msg, e| | |
if e.is_a?(GovukSidekiq::RetryableError) | |
raise e.cause | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment