#[derive(Debug, Clone)]
pub enum Error {
OutOfRangeEccentricity {
eccentricity: f64,
t: f64,
},
OutOfRangePerturbedEccentricity {
eccentricity: f64,
t: f64,
},
NegativeSemiLatusRectum {
t: f64,
},
}
impl core::fmt::Display for Error {
fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Error::OutOfRangeEccentricity { eccentricity, t } => formatter.write_fmt(
core::format_args!(
"The propagated eccentricity ({}) is outside the range [0, 1[ {} minutes after epoch (before adding third-body perturbations)",
eccentricity,
t,
)
),
Error::OutOfRangePerturbedEccentricity { eccentricity, t } => formatter.write_fmt(
core::format_args!(
"The propagated eccentricity ({}) is outside the range [0, 1[ {} minutes after epoch (after adding third-body perturbations)",
eccentricity,
t,
)
),
Error::NegativeSemiLatusRectum { t } => formatter.write_fmt(
core::format_args!("The propagated semi-latus rectum is negative {} minutes after epoch", t)
)
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for Error {}