use std::num::{ParseFloatError, ParseIntError};
use thiserror::Error;
use super::ierstable::IersTableId;
use crate::Frame;
#[derive(Debug, Error)]
pub enum Error {
#[error(
"to_gcrf: frame {frame} is not a satellite-local orbital frame; use the \
time-based quaternion helpers (qitrf2gcrf, qteme2gcrf, etc.) instead"
)]
UnsupportedFrame { frame: Frame },
#[error(
"rotation: frame pair ({from}, {to}) involves an orbit-dependent frame; \
use to_gcrf / from_gcrf with pos and vel"
)]
OrbitFrameRequiresState { from: Frame, to: Frame },
#[error(
"rotation_approx: frame {frame} has no FK5 approximate-reduction \
analogue; use rotation() for full IERS 2010"
)]
ApproxNotSupportedForFrame { frame: Frame },
#[error("Error parsing file {fname}, invalid table definition line")]
InvalidIersTableDef { fname: String },
#[error("Error parsing file {fname}, table not initialized")]
IersTableNotInitialized { fname: String },
#[error("IERS table byte buffer is not valid UTF-8: {0}")]
Utf8(#[from] std::str::Utf8Error),
#[error("IERS table singleton {id:?} is already initialized")]
IersTableAlreadyInitialized { id: IersTableId },
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
ParseInt(#[from] ParseIntError),
#[error(transparent)]
ParseFloat(#[from] ParseFloatError),
#[error(transparent)]
Datadir(#[from] crate::utils::datadir::Error),
#[error(transparent)]
Download(#[from] crate::utils::download::Error),
}
pub type Result<T> = std::result::Result<T, Error>;