Newer
Older
use std::{error::Error, fmt::Display};
/// error while setting up an `OpticScenery`
/// error while setting up an `OpticGroup`. The reasons are similar to [`OpossumError::OpticScenery`]
/// mostly runtime errors occuring during the analysis of a scenery
/// errors while handling optical spectra
/// errors not falling in one of the categories above
Other(String),
}
impl Display for OpossumError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
OpossumError::OpticScenery(m) => {
}
OpossumError::OpticGroup(m) => {
}
OpossumError::OpticPort(m) => {
OpossumError::Analysis(m) => {
write!(f, "Opossum Error::Analysis::{}", m)
}
OpossumError::Spectrum(m) => {
write!(f, "Opossum Spectrum::{}", m)
}
OpossumError::Other(m) => write!(f, "Opossum Error::Other::{}", m),
}
}
}
impl Error for OpossumError {}
impl std::convert::From<String> for OpossumError {
fn from(msg: String) -> Self {
Self::Other(msg)
}