module Opbeat::Rails::Middleware::DebugExceptionsCatcher

Public Class Methods

included(base) click to toggle source
# File lib/opbeat/rails/middleware/debug_exceptions_catcher.rb, line 5
def self.included(base)
  base.send(:alias_method_chain, :render_exception, :opbeat)
end

Public Instance Methods

render_exception_with_opbeat(env, exception) click to toggle source
# File lib/opbeat/rails/middleware/debug_exceptions_catcher.rb, line 9
def render_exception_with_opbeat(env, exception)
  begin
    evt = Opbeat::Event.from_rack_exception(exception, env)
    Opbeat.send(evt) if evt
  rescue
    ::Rails::logger.debug "Error capturing or sending exception #{$!}"
  end

  render_exception_without_opbeat(env, exception)
end