#[non_exhaustive]pub enum PgWireError {
Io(Arc<Error>),
Protocol(String),
Server(String),
Auth(String),
Tls(String),
Task(String),
Internal(String),
MessageTooLarge {
payload_bytes: usize,
limit_bytes: usize,
},
}Expand description
Error type for all pgwire-replication operations.
This enum is #[non_exhaustive]: match on it with a _ arm so that new
variants can be added without a breaking release.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Arc<Error>)
I/O error (network, file system).
Wraps std::io::Error in an Arc to preserve ErrorKind while
keeping PgWireError Clone. Use .kind() via Arc’s Deref.
Protocol(String)
Protocol error - malformed message or unexpected response.
Server(String)
Server error - PostgreSQL returned an error response.
The message typically includes SQLSTATE code.
Auth(String)
Authentication error - wrong credentials or unsupported method.
Tls(String)
TLS error - handshake failure, certificate validation, etc.
Task(String)
Task error - worker panicked or terminated unexpectedly.
Internal(String)
Internal error - bug in the library.
MessageTooLarge
A backend message announced a payload larger than the configured limit, so it was refused before any of it was buffered.
Distinct from Protocol so a caller can tell a
legitimate frame over its own
max_message_size
apart from malformed framing, and report which bound was exceeded
without parsing the message text. Non-transient: the refused payload
is never consumed, so the connection cannot be resumed.
Implementations§
Source§impl PgWireError
impl PgWireError
Sourcepub fn is_message_too_large(&self) -> bool
pub fn is_message_too_large(&self) -> bool
Returns true if this is a message-size error.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if this error is likely transient and retryable.
Transient errors include I/O errors and task errors. Non-transient errors (auth, server, protocol) typically require configuration changes.
Trait Implementations§
Source§impl Clone for PgWireError
impl Clone for PgWireError
Source§impl Debug for PgWireError
impl Debug for PgWireError
Source§impl Display for PgWireError
impl Display for PgWireError
Source§impl Error for PgWireError
impl Error for PgWireError
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()