Module: ActionController::Rescue
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::ActiveSupport::Concern
|
|
|
Instance Chain:
|
|
| Defined in: | actionpack/lib/action_controller/metal/rescue.rb |
Overview
This module is responsible for providing [rescue_from](ActiveSupport::Rescuable::ClassMethods#rescue_from) to controllers, wrapping actions to handle configured errors, and configuring when detailed exceptions must be shown.
::ActiveSupport::Rescuable - Attributes & Methods
Class Method Summary
::ActiveSupport::Concern - Extended
| class_methods | Define class methods from given block. |
| included | Evaluate given block in context of base class, so that you can write class macros here. |
| prepended | Evaluate given block in context of base class, so that you can write class macros here. |
| append_features, prepend_features | |
Instance Attribute Summary
-
#show_detailed_exceptions? ⇒ Boolean
readonly
Override this method if you want to customize when detailed exceptions must be shown.
Instance Method Summary
- #process_action private
::ActiveSupport::Rescuable - Included
| #rescue_with_handler | Delegates to the class method, but uses the instance as the subject for rescue_from handlers (method calls, |
| #handler_for_rescue | Internal handler lookup. |
Class Attribute Details
.rescue_handlers (rw)
[ GitHub ]# File 'activesupport/lib/active_support/rescuable.rb', line 15
class_attribute :rescue_handlers, default: []
.rescue_handlers? ⇒ Boolean (rw)
[ GitHub ]
# File 'activesupport/lib/active_support/rescuable.rb', line 15
class_attribute :rescue_handlers, default: []
Instance Attribute Details
#rescue_handlers (rw)
[ GitHub ]# File 'activesupport/lib/active_support/rescuable.rb', line 15
class_attribute :rescue_handlers, default: []
#rescue_handlers? ⇒ Boolean (rw)
[ GitHub ]
# File 'activesupport/lib/active_support/rescuable.rb', line 15
class_attribute :rescue_handlers, default: []
#show_detailed_exceptions? ⇒ Boolean (readonly)
Override this method if you want to customize when detailed exceptions must be shown. This method is only called when consider_all_requests_local is false. By default, it returns false, but someone may set it to request.local? so local requests in production still show the detailed exception pages.
# File 'actionpack/lib/action_controller/metal/rescue.rb', line 21
def show_detailed_exceptions? false end
Instance Method Details
#process_action (private)
[ GitHub ]# File 'actionpack/lib/action_controller/metal/rescue.rb', line 26
def process_action(*) super rescue Exception => exception request.env["action_dispatch.show_detailed_exceptions"] ||= show_detailed_exceptions? rescue_with_handler(exception) || raise end