use thiserror::Error;
pub type Result<T> = std::result::Result<T, StaticError>;
#[derive(Debug, Error)]
pub enum StaticError {
#[error("invalid input: {0}")]
InvalidInput(String),
#[error("grid error: {0}")]
Grid(String),
#[error("outside validity range: {0}")]
OutOfRange(String),
#[error("base surface crosses above the top at {nodes} node(s); worst separation {worst_m} m (thin/crossing surfaces collapse GRV)")]
CrossedSurfaces {
nodes: usize,
worst_m: f64,
},
#[error("Monte-Carlo draw #{index} failed: {source}")]
McDraw {
index: usize,
#[source]
source: Box<StaticError>,
},
#[error(transparent)]
Geo(#[from] petekio::GeoError),
#[error(transparent)]
Algo(#[from] petektools::AlgoError),
}