module Roda::RodaPlugins::ErrorHandler::InstanceMethods
def call
If an error occurs, set the response status to 500 and call
def call super rescue *opts[:error_handler_classes] => e @_response.send(:initialize) @_response.status = 500 res = _call{handle_error(e)} begin _roda_after(res) rescue => e2 if errors = env['rack.errors'] errors.puts "Error in after hook processing of error handler: #{e2.class}: #{e2.message}" e2.backtrace.each{|line| errors.puts(line)} end end res end
def handle_error(e)
the plugin without installing an error handler doesn't change
By default, have the error handler reraise the error, so using
def handle_error(e) raise e end