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
use std::error::Error;
use std::fmt;
use std::fmt::{Debug, Display, Formatter};

/// TexError that is used for custom error handling 
#[derive(Debug)]
pub enum TexError{
    /// Error in priority ranking 
    RankError,
}

impl Display for TexError{
    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
        match *self {
            TexError::RankError => write!(f, "Rank Error"),
        }
    }
}

impl Error for TexError{
    fn source(&self) -> Option<&(dyn Error + 'static)> {
        match *self{
            TexError::RankError => None,
        }
    }
}