1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
   Appellation: error <mod>
   Contrib: FL03 <jo3mccain@icloud.com>
*/
pub use self::prelude::*;

mod err;

pub mod kinds;

pub trait ErrKind {}

macro_rules! impl_error_type {
    ($($ty:ty),* $(,)*) => {
        $(impl_error_type!(@impl $ty);)*
    };
    (@impl $ty:ty) => {
        impl ErrKind for $ty {}

        impl_error_type!(@std $ty);
    };
    (@std $ty:ty) => {

        #[cfg(feature = "std")]
        impl std::error::Error for $ty {}
    };
}

impl_error_type!(
    kinds::Error,
    kinds::ExternalError,
    kinds::PredictError,
    crate::nn::ModelError
);

pub(crate) mod prelude {
    pub use super::kinds::*;
}