pub enum PoolError {
Config(String),
Closed(String),
Timeout(String),
Exhausted(String),
ConnectionCreate {
message: String,
source: Option<FactoryError>,
},
CircuitOpen {
retry_after: f64,
},
InvalidRelease(String),
}Expand description
Every error the pool raises. Mirrors the PoolError base type of the other languages;
each variant corresponds to a sibling error class.
Variants§
Config(String)
Invalid pool / breaker / retry configuration (PoolConfigError).
Closed(String)
The pool has been closed; no more connections can be acquired (PoolClosedError).
Timeout(String)
No connection became available before the acquire deadline (PoolTimeoutError).
Exhausted(String)
The pool is full and the waiter queue is at max_waiters (PoolExhaustedError).
ConnectionCreate
The factory failed to create a connection after all retries
(ConnectionCreateError). The original error is available via
Error::source/PoolError::source_error.
Fields
source: Option<FactoryError>The underlying factory error, if any.
CircuitOpen
The circuit breaker is rejecting calls to protect a failing backend
(CircuitOpenError). retry_after is the approximate seconds until it probes again.
InvalidRelease(String)
An object that is not checked out from this pool was released — a double release?
(InvalidReleaseError).
Implementations§
Source§impl PoolError
impl PoolError
Sourcepub fn source_error(&self) -> Option<&(dyn Error + 'static)>
pub fn source_error(&self) -> Option<&(dyn Error + 'static)>
Returns the underlying factory error for a PoolError::ConnectionCreate, if present.
Trait Implementations§
Source§impl Error for PoolError
impl Error for PoolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()