aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/middleware/debug_exceptions.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
index 7912b5ce82..642c7183cc 100644
--- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
@@ -38,10 +38,10 @@ module ActionDispatch
end
end
- def initialize(app, routes_app = nil, api_only = false)
- @app = app
- @routes_app = routes_app
- @api_only = api_only
+ def initialize(app, routes_app = nil, response_format = :default)
+ @app = app
+ @routes_app = routes_app
+ @response_format = response_format
end
def call(env)
@@ -67,9 +67,10 @@ module ActionDispatch
log_error(request, wrapper)
if request.get_header('action_dispatch.show_detailed_exceptions')
- if @api_only
+ case @response_format
+ when :api
render_for_api_application(request, wrapper)
- else
+ when :default
render_for_default_application(request, wrapper)
end
else