Skip to content

Commit 19fb4e5

Browse files
hamedshantonpirker
andauthored
Do not send "quiet" Sanic exceptions to Sentry. (#2821)
In Sanic some exceptions are "quiet" (https://github.com/hamedsh/sanic/blob/b8ec9ed3e6f63f4c61fd45d3e09cfc9457a53b82/sanic/exceptions.py#L9) These exceptions, do not get logged in stderror and should also not be sent to Sentry. --------- Co-authored-by: Anton Pirker <[email protected]>
1 parent a151a2a commit 19fb4e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sentry_sdk/integrations/sanic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ def _capture_exception(exception):
342342
client_options=client.options,
343343
mechanism={"type": "sanic", "handled": False},
344344
)
345+
if hint and hasattr(hint["exc_info"][0], "quiet") and hint["exc_info"][0].quiet:
346+
return
345347
hub.capture_event(event, hint=hint)
346348

347349

0 commit comments

Comments
 (0)