method
handler_for_rescue
v5.1.7 -
Show latest stable
- Class:
ActiveSupport::Rescuable::ClassMethods
handler_for_rescue(exception, object: self)public
No documentation available.
# File activesupport/lib/active_support/rescuable.rb, line 102
def handler_for_rescue(exception, object: self) #:nodoc:
case rescuer = find_rescue_handler(exception)
when Symbol
method = object.method(rescuer)
if method.arity == 0
-> e { method.call }
else
method
end
when Proc
if rescuer.arity == 0
-> e { object.instance_exec(&rescuer) }
else
-> e { object.instance_exec(e, &rescuer) }
end
end
end