Module: ActiveSupport::Rescuable
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::ActionCable::Channel::Base ,
::ActionCable::Connection::Base ,
::ActionController::API ,
::ActionController::Base ,
::ActionController::Rescue ,
::ActionMailbox::Base ,
::ActionMailer::Base ,
::ActionMailer::MailDeliveryJob ,
::ActionMailer::Rescuable ,
::ActionView::TestCase::TestController ,
::ActiveJob::Base ,
::ActiveJob::Execution ,
::ActiveRecord::DestroyAssociationAsyncJob ,
::Rails::ApplicationController ,
::Rails::HealthController ,
::Rails::InfoController ,
::Rails::MailersController ,
::Rails::PwaController ,
::Rails::WelcomeController
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Concern
|
|
Defined in: | activesupport/lib/active_support/rescuable.rb |
Overview
Rescuable
module adds support for easier exception handling.
Class Method Summary
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 Method Summary
-
#rescue_with_handler(exception)
Delegates to the class method, but uses the instance as the subject for rescue_from handlers (method calls,
instance_exec
blocks). -
#handler_for_rescue(exception)
Internal use only
Internal handler lookup.
DSL Calls
included
[ GitHub ]14 15 16
# File 'activesupport/lib/active_support/rescuable.rb', line 14
included do class_attribute :rescue_handlers, default: [] end
Instance Method Details
#handler_for_rescue(exception)
This method is for internal use only.
Internal handler lookup. Delegates to class method. Some libraries call this directly, so keeping it around for compatibility.
# File 'activesupport/lib/active_support/rescuable.rb', line 172
def handler_for_rescue(exception) # :nodoc: self.class.handler_for_rescue exception, object: self end
#rescue_with_handler(exception)
Delegates to the class method, but uses the instance as the subject for rescue_from handlers (method calls, instance_exec
blocks).
# File 'activesupport/lib/active_support/rescuable.rb', line 166
def rescue_with_handler(exception) self.class.rescue_with_handler exception, object: self end