1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3 #[error("pool is full")]
4 PoolFull,
5
6 #[error("no backend address")]
7 NoBackend,
8
9 #[error("other error: {0}")]
10 Other(Box<dyn std::error::Error + Sync + Send + 'static>),
11}
12
13impl Error {
14 pub fn from_other<E: std::error::Error + Sync + Send + 'static>(e: E) -> Self {
15 Error::Other(Box::new(e))
16 }
17}
18
19impl From<std::io::Error> for Error {
20 fn from(value: std::io::Error) -> Self {
21 Error::from_other(value)
22 }
23}