nrps_rs/
errors.rs

1// License: GNU Affero General Public License v3 or later
2// A copy of GNU AGPL v3 should have been included in this software package in LICENSE.txt.
3
4use std::io;
5use std::num;
6
7use thiserror::Error;
8use toml;
9use walkdir;
10
11#[derive(Error, Debug)]
12pub enum NrpsError {
13    #[error("Error parsing config")]
14    ConfigError(#[from] toml::de::Error),
15    #[error("Invalid result count: `{0}`")]
16    CountError(usize),
17    #[error("Dimension mismatch: `{first}` vs. `{second}`")]
18    DimensionMismatch { first: usize, second: usize },
19    #[error("Dir error")]
20    DirError(#[from] walkdir::Error),
21    #[error("Error parsing float")]
22    FloatParserError(#[from] num::ParseFloatError),
23    #[error("Error parsing int")]
24    IntParserError(#[from] num::ParseIntError),
25    #[error("Invalid feature line `{0}`")]
26    InvalidFeatureLine(String),
27    #[error("IO error")]
28    Io(#[from] io::Error),
29    #[error("Signature error `{0}`")]
30    SignatureError(String),
31    #[error("Stachelhaus signature file error `{0}`")]
32    SignatureFileError(String),
33}