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:
Christophe Robillard 2020-05-19 10:58:07 +02:00
parent d92a0ba8f3
commit 8c66b2cab1

View file

@ -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