Module: Mnemosyne::Probes::ActionDispatch::ShowExceptions::Probe::Instrumentation

Defined in:
lib/mnemosyne/probes/action_dispatch/show_exceptions.rb

Instance Method Summary collapse

Instance Method Details

#render_exception(env, exception) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mnemosyne/probes/action_dispatch/show_exceptions.rb', line 13

def render_exception(env, exception)
  if (trace = ::Mnemosyne::Instrumenter.current_trace)
    if exception.respond_to?(:unwrapped_exception) && exception.respond_to?(:exception)
      # ActionDispatch::ExceptionWrapper
      trace.attach_error(exception.exception)
    else
      trace.attach_error(exception)
    end
  end

  super
end