Skip to main content

floe_core/
errors.rs

1use std::fmt;
2
3#[derive(Debug)]
4pub struct RunError(pub String);
5
6impl fmt::Display for RunError {
7    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8        write!(f, "{}", self.0)
9    }
10}
11
12impl std::error::Error for RunError {}
13
14#[derive(Debug)]
15pub struct StorageError(pub String);
16
17impl fmt::Display for StorageError {
18    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19        write!(f, "{}", self.0)
20    }
21}
22
23impl std::error::Error for StorageError {}
24
25#[derive(Debug)]
26pub struct IoError(pub String);
27
28impl fmt::Display for IoError {
29    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30        write!(f, "{}", self.0)
31    }
32}
33
34impl std::error::Error for IoError {}