View Source EdgeDB.Error exception (EdgeDB v0.8.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

t()

@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

access_error(msg, opts \\ [])

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

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

access_policy_error(msg, opts \\ [])

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

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

authentication_error(msg, opts \\ [])

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

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

availability_error(msg, opts \\ [])

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

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

backend_error(msg, opts \\ [])

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

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

backend_unavailable_error(msg, opts \\ [])

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

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

binary_protocol_error(msg, opts \\ [])

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

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

capability_error(msg, opts \\ [])

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

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

cardinality_violation_error(msg, opts \\ [])

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

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

client_connection_closed_error(msg, opts \\ [])

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

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

client_connection_error(msg, opts \\ [])

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

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

client_connection_failed_error(msg, opts \\ [])

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

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

client_connection_failed_temporarily_error(msg, opts \\ [])

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

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

client_connection_timeout_error(msg, opts \\ [])

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

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

client_error(msg, opts \\ [])

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

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

configuration_error(msg, opts \\ [])

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

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

constraint_violation_error(msg, opts \\ [])

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

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

deprecated_scoping_error(msg, opts \\ [])

@spec deprecated_scoping_error(String.t(), Keyword.t()) :: t()

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

disabled_capability_error(msg, opts \\ [])

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

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

division_by_zero_error(msg, opts \\ [])

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

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

duplicate_cast_definition_error(msg, opts \\ [])

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

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

duplicate_constraint_definition_error(msg, opts \\ [])

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

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

duplicate_database_definition_error(msg, opts \\ [])

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

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

duplicate_definition_error(msg, opts \\ [])

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

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

duplicate_function_definition_error(msg, opts \\ [])

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

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

duplicate_migration_error(msg, opts \\ [])

@spec duplicate_migration_error(String.t(), Keyword.t()) :: t()

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

duplicate_module_definition_error(msg, opts \\ [])

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

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

duplicate_operator_definition_error(msg, opts \\ [])

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

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

duplicate_property_definition_error(msg, opts \\ [])

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

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

duplicate_user_definition_error(msg, opts \\ [])

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

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

duplicate_view_definition_error(msg, opts \\ [])

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

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

edge_ql_syntax_error(msg, opts \\ [])

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

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

execution_error(msg, opts \\ [])

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

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

graph_ql_syntax_error(msg, opts \\ [])

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

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

idle_session_timeout_error(msg, opts \\ [])

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

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

idle_transaction_timeout_error(msg, opts \\ [])

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

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

inheritor?(exception, base_error_type)

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

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

input_data_error(msg, opts \\ [])

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

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

integrity_error(msg, opts \\ [])

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

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

interface_error(msg, opts \\ [])

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

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

internal_client_error(msg, opts \\ [])

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

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

internal_server_error(msg, opts \\ [])

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

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

invalid_alias_definition_error(msg, opts \\ [])

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

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

invalid_argument_error(msg, opts \\ [])

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

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

invalid_cast_definition_error(msg, opts \\ [])

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

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

invalid_constraint_definition_error(msg, opts \\ [])

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

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

invalid_database_definition_error(msg, opts \\ [])

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

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

invalid_definition_error(msg, opts \\ [])

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

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

invalid_function_definition_error(msg, opts \\ [])

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

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

invalid_module_definition_error(msg, opts \\ [])

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

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

invalid_operator_definition_error(msg, opts \\ [])

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

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

invalid_property_definition_error(msg, opts \\ [])

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

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

invalid_property_target_error(msg, opts \\ [])

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

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

invalid_reference_error(msg, opts \\ [])

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

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

invalid_syntax_error(msg, opts \\ [])

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

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

invalid_target_error(msg, opts \\ [])

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

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

invalid_type_error(msg, opts \\ [])

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

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

invalid_user_definition_error(msg, opts \\ [])

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

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

invalid_value_error(msg, opts \\ [])

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

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

log_message(msg, opts \\ [])

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

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

missing_argument_error(msg, opts \\ [])

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

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

missing_required_error(msg, opts \\ [])

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

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

no_data_error(msg, opts \\ [])

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

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

numeric_out_of_range_error(msg, opts \\ [])

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

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

parameter_type_mismatch_error(msg, opts \\ [])

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

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

protocol_error(msg, opts \\ [])

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

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

query_argument_error(msg, opts \\ [])

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

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

query_assertion_error(msg, opts \\ [])

@spec query_assertion_error(String.t(), Keyword.t()) :: t()

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

query_error(msg, opts \\ [])

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

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

query_timeout_error(msg, opts \\ [])

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

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

reconnect?(exception)

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

result_cardinality_mismatch_error(msg, opts \\ [])

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

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

retry?(exception)

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

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

schema_definition_error(msg, opts \\ [])

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

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

schema_error(msg, opts \\ [])

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

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

schema_syntax_error(msg, opts \\ [])

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

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

server_blocked_error(msg, opts \\ [])

@spec server_blocked_error(String.t(), Keyword.t()) :: t()

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

server_offline_error(msg, opts \\ [])

@spec server_offline_error(String.t(), Keyword.t()) :: t()

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

session_timeout_error(msg, opts \\ [])

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

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

state_mismatch_error(msg, opts \\ [])

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

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

transaction_conflict_error(msg, opts \\ [])

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

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

transaction_deadlock_error(msg, opts \\ [])

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

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

transaction_error(msg, opts \\ [])

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

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

transaction_serialization_error(msg, opts \\ [])

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

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

transaction_timeout_error(msg, opts \\ [])

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

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

type_spec_not_found_error(msg, opts \\ [])

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

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

unexpected_message_error(msg, opts \\ [])

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

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

unknown_argument_error(msg, opts \\ [])

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

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

unknown_database_error(msg, opts \\ [])

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

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

unknown_module_error(msg, opts \\ [])

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

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

unknown_parameter_error(msg, opts \\ [])

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

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

unknown_property_error(msg, opts \\ [])

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

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

unknown_tenant_error(msg, opts \\ [])

@spec unknown_tenant_error(String.t(), Keyword.t()) :: t()

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

unknown_user_error(msg, opts \\ [])

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

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

unsupported_backend_feature_error(msg, opts \\ [])

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

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

unsupported_capability_error(msg, opts \\ [])

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

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

unsupported_feature_error(msg, opts \\ [])

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

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

unsupported_protocol_version_error(msg, opts \\ [])

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

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

warning_message(msg, opts \\ [])

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

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

watch_error(msg, opts \\ [])

@spec watch_error(String.t(), Keyword.t()) :: t()

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