findit_cli/
errors.rs

1use std::{io::Error as IoError, num::ParseIntError, path::PathBuf};
2use thiserror::Error;
3
4use crate::parser::parser_error::ParserError;
5
6#[derive(Error, Debug)]
7pub enum FindItError {
8    #[error("Number Parse error: `{0}`")]
9    IntParserError(#[from] ParseIntError),
10    #[error("IO Error: `{0}`")]
11    IoError(#[from] IoError),
12    #[error("No such file: `{0}`")]
13    NoSuchFile(PathBuf),
14    #[error("Bad filter: `{0}`")]
15    BadFilter(String),
16    #[error("Bad order by: `{0}`")]
17    BadOrderBy(String),
18    #[error("Bad expression: `{0}`")]
19    BadExpression(String),
20    #[error("Could not parse `{0}` because : `{0}`")]
21    DisplayParserError(String, String),
22    #[error("Expression parse error: `{0}`")]
23    ParserError(#[from] ParserError),
24    #[error("Cannot find field name: `{0}`")]
25    NoSuchField(String),
26}