MCPcopy
hub / github.com/celery/celery / fail_from_current_stack

Method fail_from_current_stack

celery/backends/base.py:405–422  ·  view source on GitHub ↗
(self, task_id, exc=None)

Source from the content-addressed store, hash-verified

403 return backend.fail_from_current_stack(group_callback.id, exc=exc)
404
405 def fail_from_current_stack(self, task_id, exc=None):
406 type_, real_exc, tb = sys.exc_info()
407 try:
408 exc = real_exc if exc is None else exc
409 exception_info = ExceptionInfo((type_, exc, tb))
410 self.mark_as_failure(task_id, exc, exception_info.traceback)
411 return exception_info
412 finally:
413 while tb is not None:
414 try:
415 tb.tb_frame.clear()
416 tb.tb_frame.f_locals
417 except RuntimeError:
418 # Ignore the exception raised if the frame is still executing.
419 pass
420 tb = tb.tb_next
421
422 del tb
423
424 def prepare_exception(self, exc, serializer=None):
425 """Prepare exception for serialization."""

Callers 3

Calls 2

mark_as_failureMethod · 0.95
clearMethod · 0.45

Tested by 1