diff --git a/InvenTree/InvenTree/exceptions.py b/InvenTree/InvenTree/exceptions.py index a7bcf9d39c..09fc4de192 100644 --- a/InvenTree/InvenTree/exceptions.py +++ b/InvenTree/InvenTree/exceptions.py @@ -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):