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

Exception returned by the client 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.

The useful ones are:

By default the client generates exception messages in full format, attempting to output all useful information about the error location if it is possible.

This behavior can be disabled by using the :render_error_hints configuration of the :edgedb application.

The renderer also tries to colorize the output message. This behavior defaults to IO.ANSI.enabled?/0, but can also be configured with the :rended_colored_errors setting for the :edgedb application.

Summary

Types

t()

Exception returned by the client if an error occurred.

Functions

Check if the exception is an inheritor of another EdgeDB error.

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.

Types

@type t() :: %EdgeDB.Error{
  message: String.t(),
  type: module(),
  name: String.t(),
  code: integer()
}

Exception returned by the client if an error occurred.

Fields:

  • :message - human-readable error message.
  • :type - alias module for EdgeDB error.
  • :name - error name from EdgeDB.
  • :code - internal error code.

Functions

Link to this function

access_error(msg, opts \\ [])

View Source
@spec access_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.AccessError type.

Link to this function

access_policy_error(msg, opts \\ [])

View Source
@spec access_policy_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.AccessPolicyError type.

Link to this function

authentication_error(msg, opts \\ [])

View Source
@spec authentication_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.AuthenticationError type.

Link to this function

availability_error(msg, opts \\ [])

View Source
@spec availability_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.AvailabilityError type.

Link to this function

backend_error(msg, opts \\ [])

View Source
@spec backend_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.BackendError type.

Link to this function

backend_unavailable_error(msg, opts \\ [])

View Source
@spec backend_unavailable_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.BackendUnavailableError type.

Link to this function

binary_protocol_error(msg, opts \\ [])

View Source
@spec binary_protocol_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.BinaryProtocolError type.

Link to this function

capability_error(msg, opts \\ [])

View Source
@spec capability_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.CapabilityError type.

Link to this function

cardinality_violation_error(msg, opts \\ [])

View Source
@spec cardinality_violation_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.CardinalityViolationError type.

Link to this function

client_connection_closed_error(msg, opts \\ [])

View Source
@spec client_connection_closed_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientConnectionClosedError type.

Link to this function

client_connection_error(msg, opts \\ [])

View Source
@spec client_connection_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientConnectionError type.

Link to this function

client_connection_failed_error(msg, opts \\ [])

View Source
@spec client_connection_failed_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientConnectionFailedError type.

Link to this function

client_connection_failed_temporarily_error(msg, opts \\ [])

View Source
@spec client_connection_failed_temporarily_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientConnectionFailedTemporarilyError type.

Link to this function

client_connection_timeout_error(msg, opts \\ [])

View Source
@spec client_connection_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientConnectionTimeoutError type.

Link to this function

client_error(msg, opts \\ [])

View Source
@spec client_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ClientError type.

Link to this function

configuration_error(msg, opts \\ [])

View Source
@spec configuration_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ConfigurationError type.

Link to this function

constraint_violation_error(msg, opts \\ [])

View Source
@spec constraint_violation_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ConstraintViolationError type.

Link to this function

disabled_capability_error(msg, opts \\ [])

View Source
@spec disabled_capability_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DisabledCapabilityError type.

Link to this function

division_by_zero_error(msg, opts \\ [])

View Source
@spec division_by_zero_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DivisionByZeroError type.

Link to this function

duplicate_cast_definition_error(msg, opts \\ [])

View Source
@spec duplicate_cast_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateCastDefinitionError type.

Link to this function

duplicate_constraint_definition_error(msg, opts \\ [])

View Source
@spec duplicate_constraint_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateConstraintDefinitionError type.

Link to this function

duplicate_database_definition_error(msg, opts \\ [])

View Source
@spec duplicate_database_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateDatabaseDefinitionError type.

Link to this function

duplicate_definition_error(msg, opts \\ [])

View Source
@spec duplicate_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateDefinitionError type.

Link to this function

duplicate_function_definition_error(msg, opts \\ [])

View Source
@spec duplicate_function_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateFunctionDefinitionError type.

Link to this function

duplicate_module_definition_error(msg, opts \\ [])

View Source
@spec duplicate_module_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateModuleDefinitionError type.

Link to this function

duplicate_operator_definition_error(msg, opts \\ [])

View Source
@spec duplicate_operator_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateOperatorDefinitionError type.

Link to this function

duplicate_property_definition_error(msg, opts \\ [])

View Source
@spec duplicate_property_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicatePropertyDefinitionError type.

Link to this function

duplicate_user_definition_error(msg, opts \\ [])

View Source
@spec duplicate_user_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateUserDefinitionError type.

Link to this function

duplicate_view_definition_error(msg, opts \\ [])

View Source
@spec duplicate_view_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.DuplicateViewDefinitionError type.

Link to this function

edge_ql_syntax_error(msg, opts \\ [])

View Source
@spec edge_ql_syntax_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.EdgeQLSyntaxError type.

Link to this function

execution_error(msg, opts \\ [])

View Source
@spec execution_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ExecutionError type.

Link to this function

graph_ql_syntax_error(msg, opts \\ [])

View Source
@spec graph_ql_syntax_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.GraphQLSyntaxError type.

Link to this function

idle_session_timeout_error(msg, opts \\ [])

View Source
@spec idle_session_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.IdleSessionTimeoutError type.

Link to this function

idle_transaction_timeout_error(msg, opts \\ [])

View Source
@spec idle_transaction_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.IdleTransactionTimeoutError type.

Link to this function

inheritor?(exception, base_error_type)

View Source (since 0.2.0)
@spec inheritor?(t(), module()) :: boolean()

Check if the exception is an inheritor of another EdgeDB error.

Link to this function

input_data_error(msg, opts \\ [])

View Source
@spec input_data_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InputDataError type.

Link to this function

integrity_error(msg, opts \\ [])

View Source
@spec integrity_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.IntegrityError type.

Link to this function

interface_error(msg, opts \\ [])

View Source
@spec interface_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InterfaceError type.

Link to this function

internal_client_error(msg, opts \\ [])

View Source
@spec internal_client_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InternalClientError type.

Link to this function

internal_server_error(msg, opts \\ [])

View Source
@spec internal_server_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InternalServerError type.

Link to this function

invalid_alias_definition_error(msg, opts \\ [])

View Source
@spec invalid_alias_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidAliasDefinitionError type.

Link to this function

invalid_argument_error(msg, opts \\ [])

View Source
@spec invalid_argument_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidArgumentError type.

Link to this function

invalid_cast_definition_error(msg, opts \\ [])

View Source
@spec invalid_cast_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidCastDefinitionError type.

Link to this function

invalid_constraint_definition_error(msg, opts \\ [])

View Source
@spec invalid_constraint_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidConstraintDefinitionError type.

Link to this function

invalid_database_definition_error(msg, opts \\ [])

View Source
@spec invalid_database_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidDatabaseDefinitionError type.

Link to this function

invalid_definition_error(msg, opts \\ [])

View Source
@spec invalid_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidDefinitionError type.

Link to this function

invalid_function_definition_error(msg, opts \\ [])

View Source
@spec invalid_function_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidFunctionDefinitionError type.

Link to this function

invalid_module_definition_error(msg, opts \\ [])

View Source
@spec invalid_module_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidModuleDefinitionError type.

Link to this function

invalid_operator_definition_error(msg, opts \\ [])

View Source
@spec invalid_operator_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidOperatorDefinitionError type.

Link to this function

invalid_property_definition_error(msg, opts \\ [])

View Source
@spec invalid_property_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidPropertyDefinitionError type.

Link to this function

invalid_property_target_error(msg, opts \\ [])

View Source
@spec invalid_property_target_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidPropertyTargetError type.

Link to this function

invalid_reference_error(msg, opts \\ [])

View Source
@spec invalid_reference_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidReferenceError type.

Link to this function

invalid_syntax_error(msg, opts \\ [])

View Source
@spec invalid_syntax_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidSyntaxError type.

Link to this function

invalid_target_error(msg, opts \\ [])

View Source
@spec invalid_target_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidTargetError type.

Link to this function

invalid_type_error(msg, opts \\ [])

View Source
@spec invalid_type_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidTypeError type.

Link to this function

invalid_user_definition_error(msg, opts \\ [])

View Source
@spec invalid_user_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidUserDefinitionError type.

Link to this function

invalid_value_error(msg, opts \\ [])

View Source
@spec invalid_value_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.InvalidValueError type.

Link to this function

log_message(msg, opts \\ [])

View Source
@spec log_message(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.LogMessage type.

Link to this function

missing_argument_error(msg, opts \\ [])

View Source
@spec missing_argument_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.MissingArgumentError type.

Link to this function

missing_required_error(msg, opts \\ [])

View Source
@spec missing_required_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.MissingRequiredError type.

Link to this function

no_data_error(msg, opts \\ [])

View Source
@spec no_data_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.NoDataError type.

Link to this function

numeric_out_of_range_error(msg, opts \\ [])

View Source
@spec numeric_out_of_range_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.NumericOutOfRangeError type.

Link to this function

parameter_type_mismatch_error(msg, opts \\ [])

View Source
@spec parameter_type_mismatch_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ParameterTypeMismatchError type.

Link to this function

protocol_error(msg, opts \\ [])

View Source
@spec protocol_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ProtocolError type.

Link to this function

query_argument_error(msg, opts \\ [])

View Source
@spec query_argument_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.QueryArgumentError type.

Link to this function

query_error(msg, opts \\ [])

View Source
@spec query_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.QueryError type.

Link to this function

query_timeout_error(msg, opts \\ [])

View Source
@spec query_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.QueryTimeoutError type.

@spec 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.

Link to this function

result_cardinality_mismatch_error(msg, opts \\ [])

View Source
@spec result_cardinality_mismatch_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.ResultCardinalityMismatchError type.

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

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

Link to this function

schema_definition_error(msg, opts \\ [])

View Source
@spec schema_definition_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.SchemaDefinitionError type.

Link to this function

schema_error(msg, opts \\ [])

View Source
@spec schema_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.SchemaError type.

Link to this function

schema_syntax_error(msg, opts \\ [])

View Source
@spec schema_syntax_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.SchemaSyntaxError type.

Link to this function

session_timeout_error(msg, opts \\ [])

View Source
@spec session_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.SessionTimeoutError type.

Link to this function

state_mismatch_error(msg, opts \\ [])

View Source
@spec state_mismatch_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.StateMismatchError type.

Link to this function

transaction_conflict_error(msg, opts \\ [])

View Source
@spec transaction_conflict_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TransactionConflictError type.

Link to this function

transaction_deadlock_error(msg, opts \\ [])

View Source
@spec transaction_deadlock_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TransactionDeadlockError type.

Link to this function

transaction_error(msg, opts \\ [])

View Source
@spec transaction_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TransactionError type.

Link to this function

transaction_serialization_error(msg, opts \\ [])

View Source
@spec transaction_serialization_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TransactionSerializationError type.

Link to this function

transaction_timeout_error(msg, opts \\ [])

View Source
@spec transaction_timeout_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TransactionTimeoutError type.

Link to this function

type_spec_not_found_error(msg, opts \\ [])

View Source
@spec type_spec_not_found_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.TypeSpecNotFoundError type.

Link to this function

unexpected_message_error(msg, opts \\ [])

View Source
@spec unexpected_message_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnexpectedMessageError type.

Link to this function

unknown_argument_error(msg, opts \\ [])

View Source
@spec unknown_argument_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownArgumentError type.

Link to this function

unknown_database_error(msg, opts \\ [])

View Source
@spec unknown_database_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownDatabaseError type.

Link to this function

unknown_module_error(msg, opts \\ [])

View Source
@spec unknown_module_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownModuleError type.

Link to this function

unknown_parameter_error(msg, opts \\ [])

View Source
@spec unknown_parameter_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownParameterError type.

Link to this function

unknown_property_error(msg, opts \\ [])

View Source
@spec unknown_property_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownPropertyError type.

Link to this function

unknown_user_error(msg, opts \\ [])

View Source
@spec unknown_user_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnknownUserError type.

Link to this function

unsupported_backend_feature_error(msg, opts \\ [])

View Source
@spec unsupported_backend_feature_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnsupportedBackendFeatureError type.

Link to this function

unsupported_capability_error(msg, opts \\ [])

View Source
@spec unsupported_capability_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnsupportedCapabilityError type.

Link to this function

unsupported_feature_error(msg, opts \\ [])

View Source
@spec unsupported_feature_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnsupportedFeatureError type.

Link to this function

unsupported_protocol_version_error(msg, opts \\ [])

View Source
@spec unsupported_protocol_version_error(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.UnsupportedProtocolVersionError type.

Link to this function

warning_message(msg, opts \\ [])

View Source
@spec warning_message(String.t(), Keyword.t()) :: t()

Create a new EdgeDB.Error with EdgeDB.WarningMessage type.