mobc/
error.rs

1use thiserror::Error;
2/// The error type returned by methods in this crate.
3#[derive(Error, Debug)]
4pub enum Error<E> {
5    /// Manager Errors
6    #[error("{0}")]
7    Inner(E),
8    /// Timeout
9    #[error("Time out in the connection pool")]
10    Timeout,
11    /// BadConn
12    #[error("Bad connection in mobc")]
13    BadConn,
14    /// The pool has been closed or dropped
15    #[error("The pool is closed")]
16    PoolClosed,
17}
18
19impl<E> From<E> for Error<E> {
20    fn from(e: E) -> Error<E> {
21        Error::Inner(e)
22    }
23}