diff --git a/lib/web_console/engine.rb b/lib/web_console/engine.rb index 650f511c..98c5fa97 100644 --- a/lib/web_console/engine.rb +++ b/lib/web_console/engine.rb @@ -27,7 +27,10 @@ class Engine < ::Rails::Engine ActionDispatch::DebugExceptions.class_eval do def render_exception_with_web_console(env, exception) render_exception_without_web_console(env, exception).tap do - env['web_console.exception'] = exception + wrapper = ActionDispatch::ExceptionWrapper.new(env, exception) + + # Get the original exception if ExceptionWrapper decides to follow it. + env['web_console.exception'] = wrapper.exception end end