pub enum Error {
Show 14 variants
Connection(String),
Authentication(String),
Protocol(String),
Sql(String),
JsonDecode(Error),
Io(Error),
Config(String),
Cancelled,
InvalidSchema(String),
ConnectionBusy(String),
InvalidState {
expected: String,
actual: String,
},
ConnectionClosed,
Deserialization {
type_name: String,
details: String,
},
MemoryLimitExceeded {
limit: usize,
estimated_memory: usize,
},
}Expand description
Main error type for fraiseql-wire operations
Variants§
Connection(String)
Connection error
Authentication(String)
Authentication error
Protocol(String)
Protocol violation
Sql(String)
SQL execution error
JsonDecode(Error)
JSON decoding error
Io(Error)
I/O error
Config(String)
Invalid configuration
Cancelled
Query cancelled by client
InvalidSchema(String)
Invalid result schema (not single data column)
ConnectionBusy(String)
Connection already in use
InvalidState
Invalid connection state
ConnectionClosed
Connection closed
Deserialization
Type deserialization error
Occurs when a row cannot be deserialized into the target type. This is a consumer-side error that includes the type name and serde details.
Fields
MemoryLimitExceeded
Memory limit exceeded
Terminal error: The consumer cannot keep pace with data arrival.
Occurs when estimated buffered memory exceeds the configured maximum. This indicates the consumer is too slow relative to data arrival rate.
NOT retriable: Retrying the same query with the same consumer will hit the same limit.
Solutions:
- Increase consumer throughput (faster
.next()polling) - Reduce items in flight (configure lower
chunk_size) - Remove memory limit (use unbounded mode)
- Use different transport (consider
tokio-postgresfor flexibility)
Implementations§
Source§impl Error
impl Error
Sourcepub fn connection<S: Into<String>>(msg: S) -> Self
pub fn connection<S: Into<String>>(msg: S) -> Self
Create a connection error with context
Sourcepub fn connection_refused(host: &str, port: u16) -> Self
pub fn connection_refused(host: &str, port: u16) -> Self
Create a connection refused error (helpful message for debugging)
Sourcepub fn invalid_schema_columns(num_columns: usize) -> Self
pub fn invalid_schema_columns(num_columns: usize) -> Self
Create a schema validation error (query returned wrong columns)
Sourcepub fn invalid_schema<S: Into<String>>(msg: S) -> Self
pub fn invalid_schema<S: Into<String>>(msg: S) -> Self
Create an invalid schema error with context
Sourcepub fn auth_failed(username: &str, reason: &str) -> Self
pub fn auth_failed(username: &str, reason: &str) -> Self
Create an authentication error with helpful message
Sourcepub fn config_invalid<S: Into<String>>(msg: S) -> Self
pub fn config_invalid<S: Into<String>>(msg: S) -> Self
Create a config error with helpful message
Sourcepub const fn is_retriable(&self) -> bool
pub const fn is_retriable(&self) -> bool
Check if error is retriable (transient)
Retriable errors typically indicate temporary issues that may succeed on retry:
- I/O errors (network timeouts, etc.)
- Connection closed (can reconnect)
Non-retriable errors indicate permanent problems:
- Invalid schema (won’t change between attempts)
- Invalid configuration (needs user intervention)
- SQL errors (query is invalid)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()