Group Honeybadger Rack::Timeout::RequestTimeoutExceptions (#5231) [deploy]

This commit is contained in:
Molly Struve 2019-12-23 19:34:08 -06:00 committed by GitHub
parent 771fa5b782
commit 9638e3da26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,8 @@ Honeybadger.configure do |config|
notice.error_message
elsif notice.error_message&.include?("BANNED")
"banned"
elsif notice.error_message&.include?("Rack::Timeout::RequestTimeoutException")
"rack_timeout"
elsif notice.component&.include?("internal")
"internal"
end

View file

@ -21,6 +21,16 @@ describe Honeybadger do
end
end
context "when Rack::Timeout::RequestTimeoutException is raised" do
it "sets fingerprint to rack_timeout" do
notice = Honeybadger::Notice.new(
described_class.config, error_message: "Rack::Timeout::RequestTimeoutException happened"
)
described_class.config.before_notify_hooks.first.call(notice)
expect(notice.fingerprint).to eq("rack_timeout")
end
end
context "when error is raised from an internal route" do
it "halts notification" do
notice = Honeybadger::Notice.new(