mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Ignore validation errors when uploading to sentry.io (#4594)
* Ignore validation errors when uploading to sentry.io * Don't actually return, silly!
This commit is contained in:
parent
0b6e2ee592
commit
46cd109359
@ -64,7 +64,15 @@ def exception_handler(exc, context):
|
||||
if settings.SENTRY_ENABLED and settings.SENTRY_DSN and not settings.DEBUG:
|
||||
# Report this exception to sentry.io
|
||||
from sentry_sdk import capture_exception
|
||||
capture_exception(exc)
|
||||
|
||||
# The following types of errors are ignored, they are "expected"
|
||||
do_not_report = [
|
||||
DjangoValidationError,
|
||||
DRFValidationError,
|
||||
]
|
||||
|
||||
if not any([isinstance(exc, err) for err in do_not_report]):
|
||||
capture_exception(exc)
|
||||
|
||||
# Catch any django validation error, and re-throw a DRF validation error
|
||||
if isinstance(exc, DjangoValidationError):
|
||||
|
Loading…
Reference in New Issue
Block a user