Class: ActionDispatch::DebugExceptions
- Inherits:
-
Object
- Object
- ActionDispatch::DebugExceptions
- Defined in:
- lib/action_dispatch/debug_exceptions.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/action_dispatch/debug_exceptions.rb', line 5 def call(env) request = Request.new(env) if request.put? && request.xhr? && allowed?(request) && m = env["PATH_INFO"].match(%r{/repl_sessions/(?<id>.+?)\z}) update_repl_session(m[:id], request.params[:input]) elsif request.post? && request.xhr? && allowed?(request) && m = env["PATH_INFO"].match(%r{/repl_sessions/(?<id>.+?)/trace\z}) change_stack_trace(m[:id], request.params[:frame_id]) else middleware_call(env) end end |
#middleware_call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/action_dispatch/debug_exceptions.rb', line 17 def middleware_call(env) _, headers, body = response = @app.call(env) if headers['X-Cascade'] == 'pass' body.close if body.respond_to?(:close) raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}" end response rescue Exception => exception raise exception if env['action_dispatch.show_exceptions'] == false render_exception(env, exception) end |