Expand description
Error handling for probabilistic programming operations.
This module provides structured error types with rich context information for graceful handling of common failure modes in probabilistic computation.
§Scope (finding FG-33)
ErrorCode intentionally only enumerates codes that fugue’s own code paths
actually construct today, verified with grep -rn 'ErrorCode::' src/. An
earlier revision of this module carried 22 variants across 6 categories
(numerical instability, inference non-convergence, trace corruption, …) of
which only 11 were ever produced by real logic; the rest were aspirational
placeholders that overstated how much of the crate’s failure surface was
actually captured by structured errors (the numerical/model-execution paths
they were meant for return NaN/-inf or panic-free Options instead, or —
for crate::inference::vi::GuideError and crate::inference::abc::ABCError
— got dedicated, more precise algorithm-specific error types rather than being
shoehorned into this general enum). See CHANGELOG.md for the removed list.
The live codes today:
| Code | Category | Constructed in |
|---|---|---|
InvalidMean/InvalidVariance/InvalidProbability/InvalidRange/InvalidShape/InvalidRate/InvalidCount | Distribution validation (1xx) | core::distribution constructors |
AddressConflict | Model execution (3xx) | runtime::interpreters (duplicate sample address) |
UnexpectedModelStructure | Model execution (3xx) | runtime::interpreters (replay/score structure mismatch) |
TraceAddressNotFound | Trace manipulation (5xx) | runtime::trace typed accessors |
TypeMismatch | Type system (6xx) | runtime::trace typed accessors |
Structs§
- Error
Context - Enhanced error context providing debugging information.
Enums§
- Error
Category - High-level error categories for filtering and handling.
- Error
Code - Error codes for programmatic error handling and categorization.
- Fugue
Error - Errors that can occur during probabilistic programming operations.
Traits§
- Validate
- Trait for validating distribution parameters.
Type Aliases§
- Fugue
Result - Result type for fallible probabilistic operations.