From 38af00f0dba3da2b1f341bcc6db06a72457bd432 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 8 Apr 2024 16:03:13 +0530 Subject: [PATCH] fix(sentry): correctly skip `frappe.ValidationError` and its children Signed-off-by: Akhil Narang --- frappe/utils/sentry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/utils/sentry.py b/frappe/utils/sentry.py index 157b8bd8cd..3c1bbfdb1a 100644 --- a/frappe/utils/sentry.py +++ b/frappe/utils/sentry.py @@ -126,7 +126,7 @@ def capture_exception(message: str | None = None) -> None: exc_info = sys.exc_info() if any(exc_info): # Don't report validation errors - if isinstance(exc_info[0], frappe.ValidationError): + if isinstance(exc_info[1], frappe.ValidationError): return event, hint = event_from_exception(