1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error(transparent)]
    Parser(#[from] nom::error::Error<String>),

    #[error(transparent)]
    SerializationError(#[from] serde_json::Error),

    #[error(
        "the filter has a wrong format, after parsing the input \"{0}\", the part \"{1}\" remains"
    )]
    WrongFilterFormat(String, String),

    #[error("The applied filter is invalid")]
    InvalidFilter,
}