//! Error types for orbital mechanics operations. use serde::{Deserialize, Serialize}; /// Errors that can occur during orbital mechanics operations. #[derive(Debug, Clone, thiserror::Error, Serialize, Deserialize)] pub enum OrbitalError { /// TLE parsing failed. #[error("TLE parse error: {0}")] TleParseError(String), /// TLE checksum verification failed. #[error("TLE checksum error on line {line}: expected {expected}, got {got}")] TleChecksumError { /// Which line (1 or 2). line: u8, /// Expected checksum digit. expected: u8, /// Computed checksum digit. got: u8, }, /// Propagation failed (satellite may have decayed or eccentricity diverged). #[error("propagation error: {0}")] PropagationError(String), /// Satellite orbit has decayed (perigee below Earth surface). #[error("satellite has decayed")] SatelliteDecayed, /// Eccentricity outside valid range [0, 1). #[error("invalid eccentricity: {0}")] InvalidEccentricity(f64), /// Kepler's equation or other iterative solver did not converge. #[error("iterative solver did not converge")] ConvergenceError, } /// Convenience alias for orbital results. pub type OrbitalResult = Result;