Reference
Errors
Errors are product surface: typed, importable one level deep, and written to name the offending source, the rows, both timestamps where temporal, and a concrete fix. This catalog is captured from the installed package’s inheritance tree.
import mostlyright as mr
try: frame = mr.align(spine, source)except mr.LeakageError as e: ... # the guard tripped; e names the source, rows, and fixexcept mr.ContractError: ... # a frame does not conform to its contractexcept mr.NoDataError: ... # nothing came backmr.LeakageError, mr.ContractError, and mr.NoDataError are importable one deep (the requests.HTTPError convention). Everything below inherits MostlyRightError unless noted.
The core families
Section titled “The core families”| Family | Members | Raised when |
|---|---|---|
| Leakage | LeakageError, OpenMeteoSeamlessLeakageError | A source row postdates the decision cutoff |
| Contract | ContractError, LabelAlignmentError, SchemaValidationError, IssuedAtMissingError, UnitsContractError | A frame, label, or schema does not conform |
| No data | NoDataError → LiveStreamError → NoLiveDataError → NoCWOPDataError | Nothing came back, at increasing specificity |
| Availability | DataAvailabilityError, SourceUnavailableError, PayloadTooLargeError | A source, extra, or payload cannot be served |
| Provenance | SourceMismatchError | Train/serve source identity diverges |
| Temporal | TemporalDriftError | Clock or timeline inconsistency |
Domain families
Section titled “Domain families”| Domain | Members |
|---|---|
| NWP | NwpError → NwpModelNotAvailableError, NwpModelRetiredError, GribIntegrityError, HistoricalDepthError, NoLiveForNwpError, StormNotFoundError |
| Satellite | SatelliteError → GoesS3Error, GoesDataCorruptError (→ UnitsContractError), ProductNotRegisteredError, StationOutOfGridError |
| Econ | IndicatorNotYetReleasedError, EarningsError → EarningsFactCorruptError |
| Markets | PolymarketStrikeError, PolymarketEventError, PolymarketSettlementError, TooEarlyToSettleError, DeferredMarketError |
One deliberate exception in markets: KalshiTickerError subclasses ValueError, not MostlyRightError, because a malformed ticker is a caller-input error in the standard Python sense. Catch it separately when parsing user-supplied tickers.
What an error message owes you
Section titled “What an error message owes you”The SDK’s error-copy contract: every user-facing error carries the offending source id, the entity or rows involved, both timestamps where the failure is temporal, and a concrete fix. Example, verbatim shape:
Leakage detected in source 'weather.forecasts.gfs': 3 row(s) carry aknowledge_time after the spine decision_time cutoff 2025-01-02T00:00:00+00:00.Fix: filter the source to knowledge_time <= your decision_time before callingalign(), or call mr.provenance(frame) to inspect the offending rows.Unknown entities fail with a nearest-match hint (unknown entity 'KNYX'; did you mean 'KNYC'?), never fuzzy auto-correction.
See also
Section titled “See also”- Temporal safety: the guard behind
LeakageError - Markets: venue error semantics in context
- API surface: domains and signatures