interp1d/
error.rs

1
2use thiserror::Error;
3
4pub type Result<T> = core::result::Result<T, InterpError>;
5
6#[derive(Error, Debug)]
7pub enum InterpError{
8    #[error("Data contains a nan or inf")]
9    InvalidData,
10
11    #[error("Interpolation requested out of range. \
12             Point is to the left of all data. \
13             point: {point}; min: {min}")]
14    OutOfRangeLeft { point: String, min: String },
15
16    #[error("Interpolation requested out of range. \
17             Point is to the left of all data. \
18             point: {point}; min: {max}")]
19    OutOfRangeRight { point: String, max: String },
20
21    #[error("U -> T try_from conversion failed")]
22    ValueFromTFailed
23}