View Source EdgeDB.Error exception (EdgeDB v0.1.0)

Exception returned by the driver if an error occurred.

Most of the functions in the EdgeDB.Error module are a shorthands for simplifying EdgeDB.Error exception constructing. These functions are generated at compile time from a copy of the errors.txt file.

Link to this section Summary

Types

Options for constructing an EdgeDB.Error instance.

t()

Exception returned by the driver if an error occurred.

Error tags.

Functions

Check if should try to reconnect to EdgeDB server.

Check if should try to repeat the query during the execution of which an error occurred.

Link to this section Types

Specs

option() ::
  {:code, integer()} | {:attributes, map()} | {:query, EdgeDB.Query.t()}

Options for constructing an EdgeDB.Error instance.

Supported options:

  • :code - internal error code.
  • :attributes - additional error attributes that can be obtained from the ErrorResponse server message.
  • :query - query, which should have been executed when the error occurred.

Specs

t() :: %EdgeDB.Error{
  __exception__: term(),
  attributes: map(),
  code: integer(),
  message: String.t(),
  name: String.t(),
  query: EdgeDB.Query.t() | nil,
  tags: [tag()]
}

Exception returned by the driver if an error occurred.

Fields:

  • :message - human-readable error message.
  • :name - error name from EdgeDB.
  • :code - internal error code.
  • :attributes - additional error attributes that can be obtained from the ErrorResponse server message.
  • :tags - error tags.
  • :query - query, which should have been executed when the error occurred.

Specs

tag() :: :should_retry | :should_reconnect

Error tags.

Link to this section Functions

Specs

reconnect?(Exception.t()) :: boolean()

Check if should try to reconnect to EdgeDB server.

NOTE: this function is not used right now, because DBConnection reconnects it connection itself.

Specs

retry?(Exception.t()) :: boolean()

Check if should try to repeat the query during the execution of which an error occurred.