mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
No need to create a new module in the previous commit.
This commit is contained in:
parent
33c5689e2d
commit
ab6ff85906
4 changed files with 10 additions and 18 deletions
|
@ -28,7 +28,6 @@ module ActionController
|
|||
autoload :Rendering
|
||||
autoload :RequestForgeryProtection
|
||||
autoload :Rescue
|
||||
autoload :RescueWithHelper
|
||||
autoload :Responder
|
||||
autoload :SessionManagement
|
||||
autoload :Streaming
|
||||
|
|
|
@ -49,9 +49,7 @@ module ActionController
|
|||
AbstractController::Callbacks,
|
||||
|
||||
# The same with rescue, append it at the end to wrap as much as possible.
|
||||
Rescue,
|
||||
|
||||
RescueWithHelper
|
||||
Rescue
|
||||
]
|
||||
|
||||
MODULES.each do |mod|
|
||||
|
|
|
@ -3,6 +3,15 @@ module ActionController #:nodoc:
|
|||
extend ActiveSupport::Concern
|
||||
include ActiveSupport::Rescuable
|
||||
|
||||
def rescue_with_handler(exception)
|
||||
if ((exception.respond_to?(:original_exception)) &&
|
||||
(orig_exception = exception.original_exception) &&
|
||||
(orig_handler = handler_for_rescue(orig_exception)))
|
||||
exception = orig_exception
|
||||
end
|
||||
super(exception)
|
||||
end
|
||||
|
||||
private
|
||||
def process_action(*args)
|
||||
super
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
module ActionController #:nodoc:
|
||||
module RescueWithHelper
|
||||
|
||||
def rescue_with_handler(exception)
|
||||
if ((exception.class == ActionView::TemplateError) &&
|
||||
(orig_exception = exception.original_exception) &&
|
||||
(orig_handler = handler_for_rescue(orig_exception)))
|
||||
exception = orig_exception
|
||||
end
|
||||
super(exception)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue