mirror of https://github.com/rails/rails
Skip logging rescuable exceptions which are defined in rescue_from/retry_on/discard_on.
Update activejob/CHANGELOG.md Co-authored-by: Rafael França <rafael@franca.dev>
This commit is contained in:
parent
c02d9e5a3d
commit
0c6f32a9f9
|
@ -1,4 +1,6 @@
|
|||
* Skip logging rescuable exceptions which are defined in rescue_from/retry_on/discard_on.
|
||||
|
||||
*Hu Hailin*
|
||||
|
||||
|
||||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activejob/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -54,9 +54,11 @@ module ActiveJob
|
|||
job = event.payload[:job]
|
||||
ex = event.payload[:exception_object]
|
||||
if ex
|
||||
unless job.class.rescue_handlers.any? { |handler| handler[0] == event.payload[:exception][0] }
|
||||
error do
|
||||
"Error performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)} in #{event.duration.round(2)}ms: #{ex.class} (#{ex.message}):\n" + Array(ex.backtrace).join("\n")
|
||||
end
|
||||
end
|
||||
elsif event.payload[:aborted]
|
||||
error do
|
||||
"Error performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)} in #{event.duration.round(2)}ms: a before_perform callback halted the job execution"
|
||||
|
|
Loading…
Reference in New Issue