Coverage for src / lexigram / contracts / exceptions / execution.py: 0%
15 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
1"""Execution-related exception classes."""
3from __future__ import annotations
5from typing import Any
7from lexigram.contracts.exceptions.base import LexigramError
10class PipelineExecutionError(LexigramError):
11 """Error raised during pipeline execution."""
13 _code = "LEX_ERR_PIPE_001"
15 def __init__(
16 self,
17 step_name: str,
18 error: Exception,
19 details: dict[str, Any] | None = None,
20 **kwargs: Any,
21 ) -> None:
22 self.step_name = step_name
23 self.error = error
24 message = f"Pipeline step '{step_name}' failed: {error}"
25 super().__init__(message, details=details, **kwargs)
28class PipelineStepError(LexigramError):
29 """Error raised by a pipeline step."""
31 _code = "LEX_ERR_PIPE_002"
33 def __init__(self, message: str = "Pipeline step error", **kwargs: Any) -> None:
34 super().__init__(message, **kwargs)
37__all__ = ["PipelineExecutionError", "PipelineStepError"]