Search
ctrl/
Ask AI
Light
Dark
System

API/Errors

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:

  • EdgeDB.Error.retry?/1

  • EdgeDB.Error.inheritor?/2

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.

Copy
@type EdgeDB.Error.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.

Copy
@spec EdgeDB.Error.access_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.access_policy_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.authentication_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.availability_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.backend_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.backend_unavailable_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.binary_protocol_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.capability_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.cardinality_violation_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_connection_closed_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_connection_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_connection_failed_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_connection_failed_temporarily_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_connection_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.client_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.configuration_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.constraint_violation_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.disabled_capability_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.division_by_zero_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_cast_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_constraint_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_database_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_function_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_module_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_operator_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_property_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_user_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.duplicate_view_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.edge_ql_syntax_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.execution_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.graph_ql_syntax_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.idle_session_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.idle_transaction_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.inheritor?(t(), module()) :: boolean()

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

Copy
@spec EdgeDB.Error.input_data_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.integrity_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.interface_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.internal_client_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.internal_server_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_alias_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_argument_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_cast_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_constraint_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_database_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_function_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_module_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_operator_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_property_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_property_target_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_reference_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_syntax_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_target_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_type_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_user_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.invalid_value_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.log_message(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.missing_argument_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.missing_required_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.no_data_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.numeric_out_of_range_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.parameter_type_mismatch_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.protocol_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.query_argument_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.query_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.query_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.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.

Copy
@spec EdgeDB.Error.result_cardinality_mismatch_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.retry?(Exception.t()) :: boolean()

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

Copy
@spec EdgeDB.Error.schema_definition_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.schema_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.schema_syntax_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.session_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.state_mismatch_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.transaction_conflict_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.transaction_deadlock_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.transaction_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.transaction_serialization_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.transaction_timeout_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.type_spec_not_found_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unexpected_message_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_argument_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_database_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_module_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_parameter_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_property_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unknown_user_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unsupported_backend_feature_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unsupported_capability_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unsupported_feature_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.unsupported_protocol_version_error(String.t(), Keyword.t()) :: t()

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

Copy
@spec EdgeDB.Error.warning_message(String.t(), Keyword.t()) :: t()

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