mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #11850 from razielgn/mod-delegation-backtrace
Generalize backtrace check on DelegationError.
This commit is contained in:
commit
6aaa0447b0
1 changed files with 1 additions and 2 deletions
|
@ -192,8 +192,7 @@ class Module
|
|||
_ = #{to} # _ = client
|
||||
_.#{method}(#{definition}) # _.name(*args, &block)
|
||||
rescue NoMethodError => e # rescue NoMethodError => e
|
||||
location = "%s:%d:in `%s'" % [__FILE__, __LINE__ - 2, '#{method_prefix}#{method}'] # location = "%s:%d:in `%s'" % [__FILE__, __LINE__ - 2, 'customer_name']
|
||||
if _.nil? && e.backtrace.first == location # if _.nil? && e.backtrace.first == location
|
||||
if _.nil? && e.name == :#{method} # if _.nil? && e.name == :name
|
||||
#{exception} # # add helpful message to the exception
|
||||
else # else
|
||||
raise # raise
|
||||
|
|
Loading…
Reference in a new issue