MCPcopy
hub / github.com/celery/celery / _create_chord_error_with_cause

Function _create_chord_error_with_cause

celery/backends/base.py:68–77  ·  view source on GitHub ↗

Create a ChordError preserving the original exception as __cause__. This helper reduces code duplication across the codebase when creating ChordError instances that need to preserve the original exception.

(message, original_exc=None)

Source from the content-addressed store, hash-verified

66
67
68def _create_chord_error_with_cause(message, original_exc=None) -> ChordError:
69 """Create a ChordError preserving the original exception as __cause__.
70
71 This helper reduces code duplication across the codebase when creating
72 ChordError instances that need to preserve the original exception.
73 """
74 chord_error = ChordError(message)
75 if isinstance(original_exc, Exception):
76 chord_error.__cause__ = original_exc
77 return chord_error
78
79
80def _create_fake_task_request(task_id, errbacks=None, task_name='unknown', **extra) -> Context:

Callers 5

_unpack_chord_resultMethod · 0.90
on_chord_part_returnMethod · 0.90
unlock_chordFunction · 0.90
on_chord_part_returnMethod · 0.85

Calls 1

ChordErrorClass · 0.90

Tested by 1