method

handler_for_rescue

rails latest stable - Class: ActiveSupport::Rescuable::ClassMethods
handler_for_rescue(exception, object: self)
public

No documentation available.

# File activesupport/lib/active_support/rescuable.rb, line 105
      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