Classification of why an extraction skipped or failed. Set at the throw site so analysis tools (e.g. report.json consumers) don't have to regex error messages. String-valued so the value lands in JSON as a stable identifier.
| 14 | |
| 15 | |
| 16 | class FailureReason(str, enum.Enum): |
| 17 | """Classification of why an extraction skipped or failed. |
| 18 | |
| 19 | Set at the throw site so analysis tools (e.g. report.json consumers) |
| 20 | don't have to regex error messages. String-valued so the value lands |
| 21 | in JSON as a stable identifier. |
| 22 | """ |
| 23 | |
| 24 | # Skips |
| 25 | BLACKLISTED = "blacklisted" |
| 26 | MANPAGE_TOO_LARGE = "manpage_too_large" |
| 27 | |
| 28 | # Pre-LLM failures |
| 29 | TOO_MANY_CHUNKS = "too_many_chunks" |
| 30 | MANDOC_FAILED = "mandoc_failed" |
| 31 | CANCELLED = "cancelled" |
| 32 | |
| 33 | # LLM response failures |
| 34 | INVALID_RESPONSE = "invalid_response" |
| 35 | INVALID_JSON = "invalid_json" |
| 36 | INVALID_SCHEMA = "invalid_schema" |
| 37 | |
| 38 | # Provider failures |
| 39 | CONTENT_FILTER = "content_filter" |
| 40 | PROVIDER_ERROR = "provider_error" |
| 41 | PROVIDER_BATCH_ERROR = "provider_batch_error" |
| 42 | |
| 43 | # Post-processing failures |
| 44 | LINE_SPAN_COVERAGE = "line_span_coverage" |
| 45 | |
| 46 | # Fallback |
| 47 | UNEXPECTED = "unexpected" |
| 48 | |
| 49 | |
| 50 | class ExtractionError(Exception): |
nothing calls this directly
no outgoing calls
no test coverage detected