123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::Rescuable

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
::ActionController::API, ::ActionController::Base, ::ActionController::Rescue, ::ActionController::StrongParameters, ::ActionMailer::Base, ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob, ::ActionMailer::Rescuable, ::ActionView::TestCase::TestController, ::ActiveJob::Base, ::ActiveJob::Execution, Rails::ApplicationController, Rails::InfoController, Rails::MailersController, 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

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).

DSL Calls

included

[ GitHub ]


12
13
14
# File 'activesupport/lib/active_support/rescuable.rb', line 12

included do
  class_attribute :rescue_handlers, default: []
end

Instance Method Details

#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).

[ GitHub ]

  
# File 'activesupport/lib/active_support/rescuable.rb', line 164

def rescue_with_handler(exception)
  self.class.rescue_with_handler exception, object: self
end