rescue ResourceNotFound and BadFormatRequest errors
we don't have to retry this kind of errors, but just to send it to sentry
This commit is contained in:
parent
d92a0ba8f3
commit
8c66b2cab1
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,14 @@ class ApplicationJob < ActiveJob::Base
|
|||
Rails.logger.info("#{job.class.name} ended at #{Time.zone.now}")
|
||||
end
|
||||
|
||||
rescue_from(ApiEntreprise::API::ResourceNotFound) do |exception|
|
||||
error(self, exception)
|
||||
end
|
||||
|
||||
rescue_from(ApiEntreprise::API::BadFormatRequest) do |exception|
|
||||
error(self, exception)
|
||||
end
|
||||
|
||||
def error(job, exception)
|
||||
Raven.capture_exception(exception)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue