taitan_orm_trait/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#[derive(Debug)]
pub struct NotImplementError(pub String);
impl std::error::Error for NotImplementError {}
impl std::fmt::Display for NotImplementError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "method {} is not implements", self.0)
    }
}

#[derive(Debug)]
pub struct NotValidOrderByError(pub String);
impl std::error::Error for NotValidOrderByError {}
impl std::fmt::Display for NotValidOrderByError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "order by fields: {} is not valid", self.0)
    }
}

#[derive(Debug)]
pub struct NotValidConditionError(pub String);
impl std::error::Error for NotValidConditionError {}
impl std::fmt::Display for NotValidConditionError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "condition: {} is not valid", self.0)
    }
}

#[derive(Debug)]
pub struct NotValidCmpError(pub String);
impl std::error::Error for crate::error::NotValidCmpError {}
impl std::fmt::Display for crate::error::NotValidCmpError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "condition: {} is not valid", self.0)
    }
}