Class: ActionDispatch::DebugExceptions

Inherits:
Object
  • Object
show all
Defined in:
lib/web_console/extensions.rb

Instance Method Summary collapse

Instance Method Details

#render_exception_with_web_console(env, exception) ⇒ Object Also known as: render_exception



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/web_console/extensions.rb', line 25

def render_exception_with_web_console(env, exception)
  render_exception_without_web_console(env, exception).tap do
    error = ExceptionWrapper.new(env, exception).exception

    # Get the original exception if ExceptionWrapper decides to follow it.
    Thread.current[:__web_console_exception] = error

    # ActionView::Template::Error bypass ExceptionWrapper original
    # exception following. The backtrace in the view is generated from
    # reaching out to original_exception in the view.
    if error.is_a?(ActionView::Template::Error)
      Thread.current[:__web_console_exception] = error.original_exception
    end
  end
end