From 1312c70df11424fe60473da8307c135d170ffda6 Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Mon, 24 Nov 2014 17:57:42 +0200 Subject: [PATCH] Get the original exception in DebugExceptions monkey patch --- lib/web_console/engine.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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