scirs2_integrate/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug, Clone)]
7pub enum IntegrateError {
8 #[error("Computation error: {0}")]
10 ComputationError(String),
11
12 #[error("Convergence error: {0}")]
14 ConvergenceError(String),
15
16 #[error("Value error: {0}")]
18 ValueError(String),
19
20 #[error("Invalid input: {0}")]
22 InvalidInput(String),
23
24 #[error("Not implemented: {0}")]
26 NotImplementedError(String),
27
28 #[error("Linear solve error: {0}")]
30 LinearSolveError(String),
31
32 #[error("Dimension mismatch: {0}")]
34 DimensionMismatch(String),
35
36 #[error("Method switching error: {0}")]
38 MethodSwitchingError(String),
39
40 #[error("Step size too small: {0}")]
42 StepSizeTooSmall(String),
43
44 #[error("Index error: {0}")]
46 IndexError(String),
47}
48
49pub type IntegrateResult<T> = std::result::Result<T, IntegrateError>;
51
52pub type Result<T> = std::result::Result<T, IntegrateError>;