rust_car/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum CarError {
5    #[error("parsing the file error: {0}")]
6    Parsing(String),
7
8    #[error("invalid file error: {0}")]
9    InvalidFile(String),
10
11    #[error("invalid section error: {0}")]
12    InvalidSection(String),
13
14    #[error("Io error: {0}")]
15    IO(#[from] std::io::Error),
16
17    #[error("too large section error: {0}")]
18    TooLargeSection(usize),
19
20    #[error("Not found {0}")]
21    NotFound(String),
22}