1use core::fmt;
4
5#[derive(Clone, Debug, PartialEq, Eq)]
7pub enum HostError {
8 Config(String),
10 ModelNotFound(String),
12 Preprocess(String),
14 Runtime(String),
16 Download(String),
18 Integrity(String),
20 Io(String),
22}
23
24impl fmt::Display for HostError {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 match self {
27 Self::Config(m) => write!(f, "host config: {m}"),
28 Self::ModelNotFound(m) => write!(f, "model not found: {m}"),
29 Self::Preprocess(m) => write!(f, "preprocess: {m}"),
30 Self::Runtime(m) => write!(f, "runtime: {m}"),
31 Self::Download(m) => write!(f, "download: {m}"),
32 Self::Integrity(m) => write!(f, "integrity: {m}"),
33 Self::Io(m) => write!(f, "io: {m}"),
34 }
35 }
36}
37
38impl std::error::Error for HostError {}