Module: Roda::RodaPlugins::ErrorHandler::InstanceMethods

Defined in:
lib/roda/plugins/error_handler.rb

Instance Method Summary collapse

Instance Method Details

#_roda_handle_main_routeObject

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



86
87
88
89
90
91
92
93
94
# File 'lib/roda/plugins/error_handler.rb', line 86

def _roda_handle_main_route
  begin
    res = super
  ensure
    _roda_after(res)
  end
rescue *opts[:error_handler_classes] => e
  _handle_error(e)
end

#callObject

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



73
74
75
76
77
78
79
80
81
82
# File 'lib/roda/plugins/error_handler.rb', line 73

def call
  # RODA4: Remove
  begin
    res = super
  ensure
    _roda_after(res)
  end
rescue *opts[:error_handler_classes] => e
  _handle_error(e)
end