From d419d9c72e8ef572b2d2b13aef71fbf67fe4f923 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sun, 22 Jun 2025 23:59:28 +0300 Subject: [PATCH] Features: 1) Add `billiard.exceptions.WorkerLostError` to handled exceptions in Sentry configuration; Fixes: 1) Remove conditional `DEBUG` block that redundantly extended ignored errors at runtime; Extra: 1) Add comments clarifying handled exceptions; 2) Cleanup unused `DEBUG` logic for error handling. --- evibes/settings/base.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/evibes/settings/base.py b/evibes/settings/base.py index 98b1acdb..300a0b66 100644 --- a/evibes/settings/base.py +++ b/evibes/settings/base.py @@ -284,7 +284,8 @@ if getenv("SENTRY_DSN"): "django.core.exceptions.PermissionDenied", "django.core.exceptions.BadRequest", "django.db.utils.OperationalError", - "billiard.exceptions.SoftTimeLimitExceeded", + "billiard.exceptions.SoftTimeLimitExceeded", # This is a handled exception + "billiard.exceptions.WorkerLostError", # This is a handled exception "core.models.Attribute.DoesNotExist", "core.models.AttributeGroup.DoesNotExist", "core.models.AttributeValue.DoesNotExist", @@ -296,14 +297,6 @@ if getenv("SENTRY_DSN"): "blog.models.Post.DoesNotExist", ] - if DEBUG: - ignore_errors.extend( - [ - "billiard.exceptions.WorkerLostError", - "billiard.exceptions.TimeLimitExceeded", - ] - ) - sentry_sdk.init( dsn=getenv("SENTRY_DSN"), traces_sample_rate=1.0 if DEBUG else 0.2,