ignore process instance not found in terms of sentry notification

This commit is contained in:
burnettk 2023-10-01 12:36:00 -04:00
parent 8069ea28e9
commit e3f775e54f
2 changed files with 5 additions and 2 deletions

View File

@ -2001,4 +2001,4 @@
"clientPolicies" : {
"policies" : [ ]
}
}
}

View File

@ -234,7 +234,7 @@ def should_notify_sentry(exception: Exception) -> bool:
"""Determine if we should notify sentry.
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
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.
@ -242,6 +242,9 @@ def should_notify_sentry(exception: Exception) -> bool:
if isinstance(exception, ApiError):
if exception.error_code == "invalid_token":
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):
return False
return True