Skip to main content

deepwoken_reqparse/
error.rs

1
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum ReqparseError {
6    #[error("Requirement parse error: {0}")]
7    Req(String),
8    #[error("Reqfile parse error on line {line}: {message}")]
9    Reqfile {
10        line: usize,
11        message: String
12    },
13    #[error("Requirement parse error: {0}")]
14    IO(String),
15}
16
17pub type Result<T> = core::result::Result<T, ReqparseError>;
18
19impl From<std::io::Error> for ReqparseError {
20    fn from(value: std::io::Error) -> Self {
21        Self::IO(value.to_string())
22    }
23}