1 module ActionController
3 def use_rails_error_handling!
5 DEPRECATION NOTICE: controller.use_rails_error_handling! is
6 deprecated and will be removed from a future version of
9 Use rescue_action_in_public!, which is defined directly in
10 rails' testing framework, instead.
12 if ::Rails::VERSION::STRING =~ /^2\.0/
13 @use_rails_error_handling = true
15 # anything but 0.0.0.0 - borrowed from rails own rescue_action_in_public!
16 request.remote_addr = '208.77.188.166'
20 def use_rails_error_handling?
21 @use_rails_error_handling ||= false
26 if ::Rails::VERSION::STRING =~ /^2\.0/
27 def rescue_action_in_public?
28 request.respond_to?(:rescue_action_in_public?) and request.rescue_action_in_public?
31 def rescue_action_with_handler_with_fast_errors(exception)
32 if (use_rails_error_handling? || rescue_action_in_public?) & !handler_for_rescue(exception)
33 rescue_action_in_public(exception)
35 rescue_action_with_handler_without_fast_errors(exception)
38 alias_method_chain :rescue_action_with_handler, :fast_errors