Sha256: 911c9e82fde73ee4bdcab230eb21dcaa247a4c9c9121f5664a667768a3b0d2d3
Contents?: true
Size: 1.22 KB
Versions: 13
Compression:
Stored size: 1.22 KB
Contents
module Bugsnag::Middleware class ClassifyError INFO_CLASSES = [ "AbstractController::ActionNotFound", "ActionController::InvalidAuthenticityToken", "ActionController::ParameterMissing", "ActionController::UnknownAction", "ActionController::UnknownFormat", "ActionController::UnknownHttpMethod", "ActiveRecord::RecordNotFound", "CGI::Session::CookieStore::TamperedWithCookie", "Mongoid::Errors::DocumentNotFound", "SignalException", "SystemExit" ] def initialize(bugsnag) @bugsnag = bugsnag end def call(report) report.raw_exceptions.each do |ex| ancestor_chain = ex.class.ancestors.select { |ancestor| ancestor.is_a?(Class) }.map { |ancestor| ancestor.to_s } INFO_CLASSES.each do |info_class| if ancestor_chain.include?(info_class) report.severity_reason = { :type => Bugsnag::Report::ERROR_CLASS, :attributes => { :errorClass => info_class } } report.severity = 'info' break end end end @bugsnag.call(report) end end end
Version data entries
13 entries across 13 versions & 1 rubygems