module Jeanine::Rescuable::InstanceMethods

Public Instance Methods

call(env) click to toggle source
Calls superclass method
# File lib/jeanine/rescuable.rb, line 9
def call(env)
  begin
    super
  rescue => error
    handler = self.class.rescue_handlers[error.class.to_s]
    raise error unless handler
    if handler.is_a?(Symbol)
      @response.write(send(handler, error))
    else
      @response.write(instance_exec(error, &handler))
    end
    @response.complete!
  end
end