Group all BANNED errors in Honeybadger (#5027) [deploy]
This commit is contained in:
parent
390192afba
commit
addec4b72d
2 changed files with 15 additions and 3 deletions
|
|
@ -8,8 +8,10 @@ Honeybadger.configure do |config|
|
|||
config.request.filter_keys += %w[authorization]
|
||||
|
||||
config.before_notify do |notice|
|
||||
if notice.error_message&.include?("SIGTERM") && notice.component&.include?("fetch_all_rss")
|
||||
notice.fingerprint = notice.error_message
|
||||
end
|
||||
notice.fingerprint = if notice.error_message&.include?("SIGTERM") && notice.component&.include?("fetch_all_rss")
|
||||
notice.error_message
|
||||
elsif notice.error_message&.include?("BANNED")
|
||||
"banned"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,4 +10,14 @@ describe Honeybadger do
|
|||
expect(notice.fingerprint).to eq(notice.error_message)
|
||||
end
|
||||
end
|
||||
|
||||
context "when BANNED error is raised" do
|
||||
it "sets fingerprint to banned" do
|
||||
notice = Honeybadger::Notice.new(
|
||||
described_class.config, error_message: "RuntimeError: BANNED"
|
||||
)
|
||||
described_class.config.before_notify_hooks.first.call(notice)
|
||||
expect(notice.fingerprint).to eq("banned")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue