async_postgres/pg_errors

Search:
Group by:

Exception hierarchy.

All library-raised exceptions derive from PgError so callers can catch every pg-specific failure with a single except PgError clause. ProtocolError is a subtype of PgConnectionError because a protocol-level violation desynchronises the wire stream — the only viable recovery is to tear down and re-establish the connection.

Types

PgConnectionError = object of PgError
Connection failures, disconnections, SSL/auth errors.
PgError = object of CatchableError
General PostgreSQL error. Base type for all pg-specific errors.
PgNoRowsError = object of PgError
Raised by single-row/single-value queries when the result set is empty.
PgNotifyOverflowError = object of PgError
  dropped*: int              ## Number of notifications dropped due to queue overflow
PgNullError = object of PgError
Raised by single-value queries when the value is SQL NULL and the caller requested a non-nullable result.
PgPoolError = object of PgError
Pool exhaustion, pool closed, or acquire timeout.
PgQueryError = object of PgError
  sqlState*: string          ## 5-char SQLSTATE code (e.g. "42P01"), empty if unavailable.
  severity*: string          ## e.g. "ERROR", "FATAL"
  detail*: string            ## DETAIL field, empty if not present.
  hint*: string              ## HINT field, empty if not present.
SQL execution errors from the server (ErrorResponse).
PgTimeoutError = object of PgError
Operation timed out.
PgTypeError = object of PgError
Raised when a PostgreSQL value cannot be converted to the requested Nim type.
ProtocolError = object of PgConnectionError
Raised on PostgreSQL wire protocol violations. The connection stream is desynchronised after this error and must be torn down.