package postgres_async

  1. Overview
  2. Docs
type t

The type Pgasync_error.t is used for all errors in this library.

to_error returns a regular Core.Error.t that fully describes what went wrong (including but not limited to a postgres error code, if we hae one), and if you only need to show the error to someone/raise/fail then using that completely suffices.

_If_ the error due to an ErrorResponse from the server _and_ we successfully parsed an error code out of it, you can retrieve that via postgres_error_code.

Note that either of those conditions might be false, e.g. the error might be due to TCP connection failure, so we certainly won't have any postgres error code; you shouldn't take the name of the type to mean "postgres error", rather "postgres async error"---any error this library can produce.

val sexp_of_t : t -> Sexplib0.Sexp.t
val to_error : t -> Core.Error.t
val postgres_error_code : t -> string option
val raise : t -> 'a
module Postgres_field : sig ... end
val postgres_field : t -> Postgres_field.t -> string option
OCaml

Innovation. Community. Security.