Skip to main content

spatialrust_platform/
error.rs

1//! Platform crate errors.
2
3/// Result type for platform operations.
4pub type PlatformResult<T> = Result<T, PlatformError>;
5
6/// Failures in stability/conformance bookkeeping.
7#[derive(Debug, thiserror::Error)]
8pub enum PlatformError {
9    /// Invalid configuration.
10    #[error("invalid platform configuration: {0}")]
11    InvalidConfiguration(String),
12    /// A performance sample exceeded its budget ceiling.
13    #[error("performance budget `{budget_id}` exceeded: observed {observed} > ceiling {ceiling}")]
14    BudgetExceeded {
15        /// Budget identifier.
16        budget_id: String,
17        /// Observed measurement.
18        observed: u64,
19        /// Declared ceiling.
20        ceiling: u64,
21    },
22    /// Aggregated release gate denial.
23    #[error("release gate denied: {reasons:?}")]
24    ReleaseGateDenied {
25        /// Denial reasons.
26        reasons: Vec<String>,
27    },
28}