pipeline.exceptions

Pipeline exception classes with structured, user-friendly error reporting.

The :class:``PipelineExecutionError`` is raised whenever the pipeline framework
catches an error during module execution.  It bundles the module context so
that the caller (FastAPI endpoint, notebook, CLI script) receives a single
structured exception — no digging through nested tracebacks required.

Design decisions
- This module does **not** call ````logfire```` or ````logging```` directly.  Logging
  is the responsibility of the caller (````_execute_module```` in ````pipeline.py````).
  The exception merely carries structured data and provides human-readable
  ````__str__```` output.
- ````__cause__```` (the ````from e```` chain) is preserved so Python prints the full
  cause chain automatically when the exception propagates uncaught.

Classes

class pipeline.exceptions.PipelineExecutionError

Attributes

operationstr

Human-readable description of the failing operation, e.g. ``"executing module"`` or ``"evaluating ConditionalLink condition"``.

original_errorException

The root cause exception.

module_namestr | None

``mname`` of the module where the error originated, if known.

module_classstr | None

``__class__.__name__`` of the module, if known. context : dict[str, Any] Arbitrary key/value pairs that provide additional debugging context (e.g. port names, parent module, loop index).

Inherits from:

Exception

Methods:

__init__(operation: str, original_error: Exception, module_name: str | None = None, module_class: str | None = None, context: dict[str, Any] | None = None) None
as_dict() dict[str, Any]

Returns

Any
Suitable for structured logging calls::

    logfire.exception("pipeline error", **err.as_dict())
    logger.error("pipeline error", extra=err.as_dict())
format_traceback() str