method

handler_for_rescue

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: ActiveSupport::Rescuable::ClassMethods
handler_for_rescue(exception, object: self) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/rescuable.rb, line 103
      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
Register or log in to add new notes.