Skip to content

Commit 88c4369

Browse files
authored
Ignore exceptions related to team-only API keys (#3346)
2 parents fff9e67 + dd341a6 commit 88c4369

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config/initializers/sentry.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,15 @@
3535
)
3636

3737
config.before_send =
38-
lambda { |event, _hint| combined_filter.filter(event.to_hash) }
38+
lambda do |event, hint|
39+
if !Rails.env.production? &&
40+
hint[:exception].is_a?(Notifications::Client::BadRequestError) &&
41+
hint[:exception].message.include?(
42+
"Can’t send to this recipient using a team-only API key"
43+
)
44+
nil
45+
else
46+
combined_filter.filter(event.to_hash)
47+
end
48+
end
3949
end

0 commit comments

Comments
 (0)