Variant
error
The set of errors which may be raised by functions in this package.
variant error {
connection-failed(string),
invalid-params(string),
invalid-query(string),
query-failed(db-error),
value-conversion-failed(string),
unknown-prepared-statement,
access-denied,
timeout,
other(string),
}Cases
| Case | Payload | Description |
|---|---|---|
| connection-failed | string | The host could not establish or maintain a connection to the database. The operation may succeed if retried once the database is reachable. |
| invalid-params | string | A query parameter was invalid: the wrong number of parameters, a value whose type does not match the target column, or a value that could not be encoded for the wire protocol. |
| invalid-query | string | The SQL statement was rejected before it reached the database (e.g. by
host-side validation). Statements rejected by the database itself are
reported via query-failed instead. |
| query-failed | db-error | The database rejected or failed the statement. db-error carries the
structured detail (SQLSTATE code, severity, ...); branch on
db-error.code to distinguish conditions such as a unique-constraint
violation (23505). |
| value-conversion-failed | string | A value returned by the database could not be converted into a
pg-value (e.g. an unsupported column type). |
| unknown-prepared-statement | — | The prepared-statement token is not recognized: it was never prepared by this component, or has since been evicted. |
| access-denied | — | The requesting component is not permitted to reach the requested database. |
| timeout | — | The operation did not complete within the host- or backend-imposed time limit. |
| other | string | Some other implementation-specific error has occurred (e.g. I/O). Used for backend-specific failures that do not map to a named case above. |