mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-05 14:13:44 +00:00
ignore process instance not found in terms of sentry notification
This commit is contained in:
parent
8069ea28e9
commit
e3f775e54f
@ -234,7 +234,7 @@ def should_notify_sentry(exception: Exception) -> bool:
|
|||||||
"""Determine if we should notify sentry.
|
"""Determine if we should notify sentry.
|
||||||
|
|
||||||
We want to capture_exception to log the exception to sentry, but we don't want to log:
|
We want to capture_exception to log the exception to sentry, but we don't want to log:
|
||||||
1. ApiErrors that are just invalid tokens
|
1. ApiErrors that we expect to happen and that don't indicate bugs
|
||||||
2. NotAuthorizedError. we usually call check-permissions before calling an API to
|
2. NotAuthorizedError. we usually call check-permissions before calling an API to
|
||||||
make sure we'll have access, but there are some cases
|
make sure we'll have access, but there are some cases
|
||||||
where it's more convenient to just make the call from the frontend and handle the 403 appropriately.
|
where it's more convenient to just make the call from the frontend and handle the 403 appropriately.
|
||||||
@ -242,6 +242,9 @@ def should_notify_sentry(exception: Exception) -> bool:
|
|||||||
if isinstance(exception, ApiError):
|
if isinstance(exception, ApiError):
|
||||||
if exception.error_code == "invalid_token":
|
if exception.error_code == "invalid_token":
|
||||||
return False
|
return False
|
||||||
|
# when someone is looking for a process instance that doesn't exist or that they don't have access to
|
||||||
|
if exception.error_code == "process_instance_cannot_be_found":
|
||||||
|
return False
|
||||||
if isinstance(exception, NotAuthorizedError):
|
if isinstance(exception, NotAuthorizedError):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user