123456789_123456789_123456789_123456789_123456789_

Module: ActionController::Rescue

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Base, ::ActionView::TestCase::TestController, Rails::ApplicationController, Rails::InfoController, Rails::MailersController, Rails::WelcomeController
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Defined in: actionpack/lib/action_controller/metal/rescue.rb

Overview

This module is responsible to provide rescue_from helpers to controllers and configure when detailed exceptions must be shown.

::ActiveSupport::Rescuable - Attributes & Methods

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::ActiveSupport::Rescuable - Included

#handler_for_rescue,
#rescue_with_handler

Tries to rescue the exception by looking up and calling a registered handler.

Class Attribute Details

.rescue_handlers (rw)

[ GitHub ]

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

class_attribute :rescue_handlers

.rescue_handlers?Boolean (rw)

[ GitHub ]

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

class_attribute :rescue_handlers

Instance Attribute Details

#rescue_handlers (rw)

[ GitHub ]

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

class_attribute :rescue_handlers

#rescue_handlers?Boolean (rw)

[ GitHub ]

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

class_attribute :rescue_handlers

#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 shows the detailed exception pages.

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/rescue.rb', line 23

def show_detailed_exceptions?
  false
end

Instance Method Details

#rescue_with_handler(exception)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/rescue.rb', line 9

def rescue_with_handler(exception)
  if (exception.respond_to?(:original_exception) &&
      (orig_exception = exception.original_exception) &&
      handler_for_rescue(orig_exception))
    exception = orig_exception
  end
  super(exception)
end