mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
No need to create a new module in the previous commit.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user