pub enum PgError {
}Expand description
Errors returned by chopin-pg operations.
Variants§
Io(Error)
I/O error from the underlying socket.
Protocol(String)
Protocol violation or unexpected message from server.
Auth(String)
Authentication failure.
Server(Box<ServerError>)
Server-sent error response with rich diagnostic fields.
ConnectionClosed
Connection is closed or in an invalid state.
NoRows
Query returned no rows when one was expected.
TypeConversion(String)
Type conversion error.
StatementNotCached
Statement not found in cache.
BufferOverflow
Buffer overflow — message too large.
WouldBlock
Would block — operation cannot complete without blocking.
Timeout
I/O operation timed out (application-level timeout).
PoolTimeout
Pool: timed out waiting for a connection.
PoolExhausted
Pool: all connections are in use.
PoolValidationFailed
Pool: connection failed validation.
Implementations§
Source§impl PgError
impl PgError
Sourcepub fn classify(&self) -> ErrorClass
pub fn classify(&self) -> ErrorClass
Classify this error for retry decisions.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if this error is transient and the operation can be retried.
Sourcepub fn from_fields(fields: &[(u8, String)]) -> PgError
pub fn from_fields(fields: &[(u8, String)]) -> PgError
Build a Server error from parsed error/notice fields.
Trait Implementations§
Source§impl Error for PgError
impl Error for PgError
1.30.0 · 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()