module Ichnite::ActionDispatch::StructuredExceptions

Public Instance Methods

log_error(*) click to toggle source
# File lib/ichnite/action_dispatch/structured_exceptions.rb, line 23
def log_error(*)
  # no-logging
end
render_exception(_env, e) click to toggle source
Calls superclass method
# File lib/ichnite/action_dispatch/structured_exceptions.rb, line 4
def render_exception(_env, e)
  begin
    exception_name = e.class.name
    status = ::ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_name)
    if status == 500
      ::Ichnite.log('request_error',
        at: :error,
        error: exception_name,
        message: e.message[/\A.+$/].inspect
      )
    end
  rescue Exception => e2
    # never interfere with the regular exception handling
    ::Rails.logger.error(e2.inspect)
  end

  super
end