uniform_cubic_splines/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum SplineError {
8 #[error("{basis_name} curve must have at least {min_knots} knots. Found: {actual}")]
10 InvalidKnotLength {
11 basis_name: &'static str,
12 min_knots: usize,
13 actual: usize,
14 },
15
16 #[error("{basis_name} curve requires (length - 4) to be divisible by {extra}. Found length: {actual}")]
19 InvalidKnotPattern {
20 basis_name: &'static str,
21 extra: usize,
22 actual: usize,
23 },
24
25 #[cfg(feature = "monotonic_check")]
27 #[error("The knots array fed to spline_inverse() is not monotonic")]
28 NonMonotonicKnots,
29}
30
31pub type SplineResult<T> = Result<T, SplineError>;