File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import sys
4
4
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
+ )
6
11
7
12
from sentry_sdk .hub import Hub
8
13
from sentry_sdk .utils import capture_internal_exceptions , event_from_exception
12
17
from sentry_sdk .integrations .logging import ignore_logger
13
18
14
19
20
+ CELERY_CONTROL_FLOW_EXCEPTIONS = (Retry , Ignore , Reject )
21
+
22
+
15
23
class CeleryIntegration (Integration ):
16
24
identifier = "celery"
17
25
@@ -137,7 +145,7 @@ def _capture_exception(task, exc_info):
137
145
138
146
if hub .get_integration (CeleryIntegration ) is None :
139
147
return
140
- if isinstance (exc_info [1 ], Retry ):
148
+ if isinstance (exc_info [1 ], CELERY_CONTROL_FLOW_EXCEPTIONS ):
141
149
return
142
150
if hasattr (task , "throws" ) and isinstance (exc_info [1 ], task .throws ):
143
151
return
You can’t perform that action at this time.
0 commit comments