1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Error, Debug)]
6pub enum Error {
7 #[error("could not find {0}")]
8 NotFound(String),
9 #[error("could not load {0}: {1}")]
10 Library(String, libloading::Error),
11 #[error("{function} failed with {code:#010x}")]
12 Host { function: &'static str, code: u32 },
13 #[error("io error: {0}")]
14 Io(#[from] std::io::Error),
15 #[error("managed exception: {0}")]
16 Managed(String),
17 #[error("{0}")]
18 Other(String),
19}