| 48 | |
| 49 | |
| 50 | class ExtractionError(Exception): |
| 51 | def __init__( |
| 52 | self, |
| 53 | message: str, |
| 54 | raw_response: str | None = None, |
| 55 | *, |
| 56 | reason_class: FailureReason | None = None, |
| 57 | ) -> None: |
| 58 | super().__init__(message) |
| 59 | #: The raw LLM response text that caused the error. Populated only |
| 60 | #: by the LLM extractor (parse/validation failures); ``None`` for |
| 61 | #: errors raised by other extractors or generic callers. |
| 62 | self.raw_response = raw_response |
| 63 | #: Classification of the failure, set at the throw site so the |
| 64 | #: runner can propagate it onto ``ExtractionResult.reason_class`` |
| 65 | #: for downstream aggregation. |
| 66 | self.reason_class = reason_class |
| 67 | |
| 68 | |
| 69 | class SkippedExtraction(ExtractionError): |
no outgoing calls