use core::fmt;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CoreError {
NonFinite,
InsufficientCapacity,
InvalidThreshold,
InsufficientScratch,
InvalidMediaTime,
}
impl fmt::Display for CoreError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::NonFinite => "non-finite numeric value",
Self::InsufficientCapacity => "insufficient capacity",
Self::InvalidThreshold => "invalid threshold",
Self::InsufficientScratch => "insufficient NMS scratch",
Self::InvalidMediaTime => "invalid media time (zero timescale)",
})
}
}
#[cfg(feature = "std")]
impl std::error::Error for CoreError {}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum GeometryError {
NonFinite,
InvertedBounds,
DegenerateSegment,
TooFewPoints,
}
impl fmt::Display for GeometryError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::NonFinite => "non-finite geometry coordinate",
Self::InvertedBounds => "inverted rectangle bounds",
Self::DegenerateSegment => "degenerate line segment",
Self::TooFewPoints => "polygon has too few points",
})
}
}
#[cfg(feature = "std")]
impl std::error::Error for GeometryError {}