Skip to main content

vm_ch/
error.rs

1#[derive(Debug, Clone)]
2pub struct VzError {
3    message: String,
4}
5
6impl VzError {
7    pub fn new(message: impl Into<String>) -> Self {
8        VzError {
9            message: message.into(),
10        }
11    }
12}
13
14impl std::fmt::Display for VzError {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        write!(f, "{}", self.message)
17    }
18}
19
20impl std::error::Error for VzError {}
21
22pub type Result<T> = std::result::Result<T, VzError>;