27 lines
691 B
Rust
27 lines
691 B
Rust
//! Error types for material modeling operations.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Errors that can occur in material operations.
|
|
#[derive(Error, Debug)]
|
|
pub enum MaterialError {
|
|
/// Invalid input parameters
|
|
#[error("Invalid input: {0}")]
|
|
InvalidInput(String),
|
|
|
|
/// Optimization failed to converge
|
|
#[error("Optimization failed: {0}")]
|
|
OptimizationFailed(String),
|
|
|
|
/// Material property out of valid range
|
|
#[error("Property out of range: {0}")]
|
|
PropertyOutOfRange(String),
|
|
|
|
/// Numerical error
|
|
#[error("Numerical error: {0}")]
|
|
Numerical(String),
|
|
}
|
|
|
|
/// Result type for material operations.
|
|
pub type Result<T> = std::result::Result<T, MaterialError>;
|