concision_neural/
error.rs

1/*
2    Appellation: error <module>
3    Contrib: @FL03
4*/
5
6/// a type alias for a [Result] with a [NeuralError]
7pub type NeuralResult<T = ()> = core::result::Result<T, NeuralError>;
8
9#[derive(Debug, scsys_derive::VariantConstructors, thiserror::Error)]
10pub enum NeuralError {
11    #[error("Invalid Batch Size")]
12    InvalidBatchSize,
13    #[error("Invalid Input Shape")]
14    InvalidInputShape,
15    #[error("Invalid Output Shape")]
16    InvalidOutputShape,
17    #[error("Parameter Error")]
18    ParameterError(String),
19    #[error("Training Failed")]
20    TrainingFailed,
21    #[error(transparent)]
22    TrainingError(#[from] TrainingError),
23    #[error(transparent)]
24    CoreError(#[from] concision_core::error::Error),
25}
26
27#[derive(Debug, scsys_derive::VariantConstructors, thiserror::Error)]
28pub enum TrainingError {
29    #[error("Invalid Training Data")]
30    InvalidTrainingData,
31    #[error("Training Failed")]
32    TrainingFailed,
33    #[error(transparent)]
34    CoreError(#[from] concision_core::error::Error),
35}