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
use std::error::Error;
use std::fmt;

pub type ILertResult<T> = Result<T, ILertError>;

#[derive(Debug)]
pub struct ILertError {
    pub message: String
}

impl ILertError {
    pub fn new(message: &str) -> ILertError {
        ILertError {
            message: message.to_string()
        }
    }
}

impl fmt::Display for ILertError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.message)
    }
}

impl Error for ILertError {
    fn description(&self) -> &str {
        &self.message
    }
}