Skip to main content

sphereql_core/
error.rs

1#[derive(Debug, Clone, thiserror::Error)]
2pub enum SphereQlError {
3    #[error("invalid radius {0}: must be >= 0")]
4    InvalidRadius(f64),
5    #[error("invalid theta {0}: must be in [0, 2π)")]
6    InvalidTheta(f64),
7    #[error("invalid phi {0}: must be in [0, π]")]
8    InvalidPhi(f64),
9    #[error("invalid latitude {0}: must be in [-90, 90]")]
10    InvalidLatitude(f64),
11    #[error("invalid longitude {0}: must be in [-180, 180]")]
12    InvalidLongitude(f64),
13    #[error("invalid altitude {0}: must be >= 0")]
14    InvalidAltitude(f64),
15    #[error("invalid shell bounds: inner {inner} must be < outer {outer}")]
16    InvalidShellBounds { inner: f64, outer: f64 },
17    #[error("invalid band bounds: phi_min {phi_min} must be < phi_max {phi_max}")]
18    InvalidBandBounds { phi_min: f64, phi_max: f64 },
19    #[error("invalid cone: half_angle {0} must be in (0, π]")]
20    InvalidConeAngle(f64),
21    #[error("invalid cap: half_angle {0} must be in (0, π]")]
22    InvalidCapAngle(f64),
23    #[error(
24        "invalid wedge bounds: theta_min {theta_min} and theta_max {theta_max} must be in [0, 2π)"
25    )]
26    InvalidWedgeBounds { theta_min: f64, theta_max: f64 },
27    #[error("zero vector cannot be normalized")]
28    ZeroVector,
29}