25 lines
576 B
Python
25 lines
576 B
Python
"""Structured failures shared by the text runner and batch orchestrator."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class TestExecutionError(RuntimeError):
|
|
code: str
|
|
message: str
|
|
stage: str
|
|
retryable: bool = False
|
|
|
|
def __post_init__(self) -> None:
|
|
RuntimeError.__init__(self, self.message)
|
|
|
|
def as_dict(self) -> dict[str, object]:
|
|
return {
|
|
"code": self.code,
|
|
"message": self.message,
|
|
"stage": self.stage,
|
|
"retryable": self.retryable,
|
|
}
|