File tree Expand file tree Collapse file tree
sentry_sdk/integrations/celery Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,15 +329,17 @@ def _inner(*args: "Any", **kwargs: "Any") -> "Any":
329329 scope .clear_breadcrumbs ()
330330 scope .add_event_processor (_make_event_processor (task , * args , ** kwargs ))
331331
332- custom_sampling_context = {
333- "celery_job" : {
334- "task" : task .name ,
335- # for some reason, args[1] is a list if non-empty but a
336- # tuple if empty
337- "args" : list (args [1 ]),
338- "kwargs" : args [2 ],
332+ custom_sampling_context = {}
333+ with capture_internal_exceptions ():
334+ custom_sampling_context = {
335+ "celery_job" : {
336+ "task" : task .name ,
337+ # for some reason, args[1] is a list if non-empty but a
338+ # tuple if empty
339+ "args" : list (args [1 ]),
340+ "kwargs" : args [2 ],
341+ }
339342 }
340- }
341343
342344 span : "Union[Span, StreamedSpan]"
343345 span_ctx : "Union[StreamedSpan, Span, NoOpMgr]" = NoOpMgr ()
You can’t perform that action at this time.
0 commit comments