File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 22
33import sys
44
5- from celery .exceptions import SoftTimeLimitExceeded , Retry # type: ignore
5+ from celery .exceptions import ( # type: ignore
6+ SoftTimeLimitExceeded ,
7+ Retry ,
8+ Ignore ,
9+ Reject ,
10+ )
611
712from sentry_sdk .hub import Hub
813from sentry_sdk .utils import capture_internal_exceptions , event_from_exception
1217from sentry_sdk .integrations .logging import ignore_logger
1318
1419
20+ CELERY_CONTROL_FLOW_EXCEPTIONS = (Retry , Ignore , Reject )
21+
22+
1523class CeleryIntegration (Integration ):
1624 identifier = "celery"
1725
@@ -137,7 +145,7 @@ def _capture_exception(task, exc_info):
137145
138146 if hub .get_integration (CeleryIntegration ) is None :
139147 return
140- if isinstance (exc_info [1 ], Retry ):
148+ if isinstance (exc_info [1 ], CELERY_CONTROL_FLOW_EXCEPTIONS ):
141149 return
142150 if hasattr (task , "throws" ) and isinstance (exc_info [1 ], task .throws ):
143151 return
You can’t perform that action at this time.
0 commit comments