use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum OcctError {
WrongBackend,
NotDone { operation: &'static str },
InvalidInput { what: &'static str },
}
impl fmt::Display for OcctError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
OcctError::WrongBackend => {
write!(f, "shape does not belong to the OCCT backend")
}
OcctError::NotDone { operation } => {
write!(f, "OCCT operation `{operation}` did not complete")
}
OcctError::InvalidInput { what } => write!(f, "invalid input: {what}"),
}
}
}
impl std::error::Error for OcctError {}