Module: Honeybadger::Plugins::Rails::ExceptionsCatcher Private

Defined in:
lib/honeybadger/plugins/rails.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#render_exception(arg, exception, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Adds additional Honeybadger info to Request env when an exception is rendered in Rails’ middleware.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/honeybadger/plugins/rails.rb', line 17

def render_exception(arg, exception, *args)
  if arg.is_a?(::ActionDispatch::Request)
    request = arg
    env = request.env
  else
    request = ::Rack::Request.new(arg)
    env = arg
  end

  env["honeybadger.exception"] = exception
  env["honeybadger.request.url"] = begin
    request.url
  rescue
    nil
  end

  super
end