From 6716ad555a687b1e825fa71ba076e641f4dc097a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 6 Aug 2015 16:12:06 -0700 Subject: ask the request if we should show exceptions hide the env key in the request object so that other code doesn't need to know. --- actionpack/lib/action_dispatch/http/request.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/lib/action_dispatch/http') diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index eeded9ffd0..c18c2643e4 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -132,6 +132,13 @@ module ActionDispatch end end + def show_exceptions? # :nodoc: + # We're treating `nil` as "unset", and we want the default setting to be + # `true`. This logic should be extracted to `env_config` and calculated + # once. + !(env['action_dispatch.show_exceptions'.freeze] == false) + end + # Returns a symbol form of the #request_method def request_method_symbol HTTP_METHOD_LOOKUP[request_method] -- cgit v1.2.3