dharitri_vm_executor/service_error.rs
1use std::fmt::{self, Display};
2use std::{error::Error, fmt::Formatter};
3
4#[derive(Debug)]
5pub struct ServiceError {
6 message: &'static str,
7}
8
9impl ServiceError {
10 pub fn new(message: &'static str) -> Self {
11 Self { message }
12 }
13}
14
15impl Display for ServiceError {
16 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
17 write!(f, "{}", &self.message)
18 }
19}
20
21impl Error for ServiceError {}