use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ArgminError {
#[error("Invalid parameter: {text:?}")]
InvalidParameter {
text: String,
},
#[error("Not implemented: {text:?}")]
NotImplemented {
text: String,
},
#[error("Not initialized: {text:?}")]
NotInitialized {
text: String,
},
#[error("Condition violated: {text:?}")]
ConditionViolated {
text: String,
},
#[error("Checkpoint not found: {text:?}")]
CheckpointNotFound {
text: String,
},
#[error("Potential bug: {text:?}. This is potentially a bug. Please file a report on https://github.com/argmin-rs/argmin/issues")]
PotentialBug {
text: String,
},
#[error("Impossible Error: {text:?}")]
ImpossibleError {
text: String,
},
}
#[cfg(test)]
mod tests {
use super::*;
send_sync_test!(error, ArgminError);
}