MCPcopy Create free account
hub / github.com/celery/celery / fail_from_current_stack

Method fail_from_current_stack

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

Source from the content-addressed store, hash-verified

585 return backend.fail_from_current_stack(group_callback.id, exc=exc)
586
587 def fail_from_current_stack(self, task_id, exc=None):
588 type_, real_exc, tb = sys.exc_info()
589 try:
590 exc = real_exc if exc is None else exc
591 exception_info = ExceptionInfo((type_, exc, tb))
592 self.mark_as_failure(task_id, exc, exception_info.traceback)
593 return exception_info
594 finally:
595 while tb is not None:
596 try:
597 tb.tb_frame.clear()
598 tb.tb_frame.f_locals
599 except RuntimeError:
600 # Ignore the exception raised if the frame is still executing.
601 pass
602 tb = tb.tb_next
603
604 del tb
605
606 def prepare_exception(self, exc, serializer=None):
607 """Prepare exception for serialization."""

Callers 3

Calls 2

mark_as_failureMethod · 0.95
clearMethod · 0.45

Tested by 1