dharitri_vm_executor/
service_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::fmt::{self, Display};
use std::{error::Error, fmt::Formatter};

#[derive(Debug)]
pub struct ServiceError {
    message: &'static str,
}

impl ServiceError {
    pub fn new(message: &'static str) -> Self {
        Self { message }
    }
}

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

impl Error for ServiceError {}