Type Alias StatExtractionFailure
StatExtractionFailure:
| { detail: string; ok: false; reason: "unknown_prop" }
| { detail: string; ok: false; reason: "unsupported_league" }
| { detail: string; ok: false; reason: "prop_not_supported_for_league" }
| { detail: string; ok: false; reason: "adapter_returned_null" }
Type Declaration
- { detail: string; ok: false; reason: "unknown_prop" }
- { detail: string; ok: false; reason: "unsupported_league" }
- { detail: string; ok: false; reason: "prop_not_supported_for_league" }
- { detail: string; ok: false; reason: "adapter_returned_null" }
Discriminated-union result types for the
*Explainedvariants of the grading API. The null-returning originals (extractStatForProp, gradeLegFromActual) stay stable; the Explained variants carry a reason code so callers can distinguish "we don't support this league" from "the player didn't play" from "the slip used a prop name we don't know" without re-deriving from inputs.Reason codes are an additive enum — new failure modes are pushed onto the union, never renamed or repurposed.