aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-05-09 18:20:54 +0900
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-05-12 13:55:25 +0900
commit6fac9bd599eeb6b9cacdf7841811223402c501bd (patch)
tree0a743c8463000daa620bbc95b8e98f0005f2ece0 /activejob/lib
parent0018e68b5de0bcca3c567ef0141c8b8a35783a0f (diff)
downloadrails-6fac9bd599eeb6b9cacdf7841811223402c501bd.tar.gz
rails-6fac9bd599eeb6b9cacdf7841811223402c501bd.tar.bz2
rails-6fac9bd599eeb6b9cacdf7841811223402c501bd.zip
Pass the error instance as the second parameter of block executed by `discard_on`
I'm not sure what originally wanted to pass to the argument. However, as long as see the document added along with the commit, it seems just to be mistaken that trying to pass the error instance. https://github.com/rails/rails/pull/30622/files#diff-59beb0189c8c6bc862edf7fdb84ff5a7R64 Fixes #32853
Diffstat (limited to 'activejob/lib')
-rw-r--r--activejob/lib/active_job/exceptions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activejob/lib/active_job/exceptions.rb b/activejob/lib/active_job/exceptions.rb
index ae700848d0..31bbb18d7f 100644
--- a/activejob/lib/active_job/exceptions.rb
+++ b/activejob/lib/active_job/exceptions.rb
@@ -79,7 +79,7 @@ module ActiveJob
def discard_on(exception)
rescue_from exception do |error|
if block_given?
- yield self, exception
+ yield self, error
else
logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{error.cause.inspect}."
end