1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::fmt;
use std::fmt::Formatter;

#[derive(Debug)]
pub enum Error {
    ExtensionLevelExceedsDimensions,
    InsufficientTrainingData,
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        match self {
            Self::ExtensionLevelExceedsDimensions => write!(
                f,
                "Extension level has to be less than the number of dimensions"
            ),
            Self::InsufficientTrainingData => write!(f, "insufficient training data"),
        }
    }
}

impl std::error::Error for Error {}