module Roda::RodaPlugins::ErrorHandler::InstanceMethods

  1. lib/roda/plugins/error_handler.rb

Methods

Public Instance

  1. call

Public Instance methods

call ()

If an error occurs, set the response status to 500 and call the error handler.

[show source]
   # File lib/roda/plugins/error_handler.rb
76 def call
77   super
78 rescue *opts[:error_handler_classes] => e
79   @_response.send(:initialize)
80   @_response.status = 500
81   res = _call{handle_error(e)}
82   begin
83     _roda_after(res)
84   rescue => e2
85     if errors = env['rack.errors']
86       errors.puts "Error in after hook processing of error handler: #{e2.class}: #{e2.message}"
87       e2.backtrace.each{|line| errors.puts(line)}
88     end
89   end
90   res
91 end