Gel.Error exception (Gel v0.9.0)

View Source

Exception returned by the client if an error occurred.

Most of the functions in the Gel.Error module are a shorthands for simplifying Gel.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 :gel 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 :gel application.

Summary

Types

t()

Exception returned by the client if an error occurred.

Functions

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

Check if should try to reconnect to Gel server.

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

Types

t()

@type t() :: %Gel.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 Gel error.
  • :name - error name from Gel.
  • :code - internal error code.

Functions

access_error(msg, opts \\ [])

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

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

access_policy_error(msg, opts \\ [])

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

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

authentication_error(msg, opts \\ [])

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

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

availability_error(msg, opts \\ [])

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

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

backend_error(msg, opts \\ [])

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

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

backend_unavailable_error(msg, opts \\ [])

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

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

binary_protocol_error(msg, opts \\ [])

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

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

capability_error(msg, opts \\ [])

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

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

cardinality_violation_error(msg, opts \\ [])

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

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

client_connection_closed_error(msg, opts \\ [])

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

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

client_connection_error(msg, opts \\ [])

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

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

client_connection_failed_error(msg, opts \\ [])

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

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

client_connection_failed_temporarily_error(msg, opts \\ [])

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

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

client_connection_timeout_error(msg, opts \\ [])

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

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

client_error(msg, opts \\ [])

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

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

configuration_error(msg, opts \\ [])

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

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

constraint_violation_error(msg, opts \\ [])

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

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

deprecated_scoping_error(msg, opts \\ [])

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

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

disabled_capability_error(msg, opts \\ [])

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

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

division_by_zero_error(msg, opts \\ [])

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

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

duplicate_cast_definition_error(msg, opts \\ [])

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

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

duplicate_constraint_definition_error(msg, opts \\ [])

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

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

duplicate_database_definition_error(msg, opts \\ [])

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

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

duplicate_definition_error(msg, opts \\ [])

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

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

duplicate_function_definition_error(msg, opts \\ [])

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

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

duplicate_migration_error(msg, opts \\ [])

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

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

duplicate_module_definition_error(msg, opts \\ [])

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

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

duplicate_operator_definition_error(msg, opts \\ [])

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

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

duplicate_property_definition_error(msg, opts \\ [])

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

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

duplicate_user_definition_error(msg, opts \\ [])

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

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

duplicate_view_definition_error(msg, opts \\ [])

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

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

edge_ql_syntax_error(msg, opts \\ [])

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

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

execution_error(msg, opts \\ [])

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

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

graph_ql_syntax_error(msg, opts \\ [])

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

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

idle_session_timeout_error(msg, opts \\ [])

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

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

idle_transaction_timeout_error(msg, opts \\ [])

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

Create a new Gel.Error with Gel.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 Gel error.

input_data_error(msg, opts \\ [])

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

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

integrity_error(msg, opts \\ [])

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

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

interface_error(msg, opts \\ [])

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

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

internal_client_error(msg, opts \\ [])

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

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

internal_server_error(msg, opts \\ [])

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

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

invalid_alias_definition_error(msg, opts \\ [])

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

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

invalid_argument_error(msg, opts \\ [])

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

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

invalid_cast_definition_error(msg, opts \\ [])

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

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

invalid_constraint_definition_error(msg, opts \\ [])

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

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

invalid_database_definition_error(msg, opts \\ [])

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

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

invalid_definition_error(msg, opts \\ [])

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

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

invalid_function_definition_error(msg, opts \\ [])

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

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

invalid_module_definition_error(msg, opts \\ [])

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

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

invalid_operator_definition_error(msg, opts \\ [])

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

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

invalid_property_definition_error(msg, opts \\ [])

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

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

invalid_property_target_error(msg, opts \\ [])

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

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

invalid_reference_error(msg, opts \\ [])

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

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

invalid_syntax_error(msg, opts \\ [])

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

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

invalid_target_error(msg, opts \\ [])

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

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

invalid_type_error(msg, opts \\ [])

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

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

invalid_user_definition_error(msg, opts \\ [])

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

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

invalid_value_error(msg, opts \\ [])

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

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

log_message(msg, opts \\ [])

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

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

missing_argument_error(msg, opts \\ [])

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

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

missing_required_error(msg, opts \\ [])

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

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

no_data_error(msg, opts \\ [])

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

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

numeric_out_of_range_error(msg, opts \\ [])

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

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

parameter_type_mismatch_error(msg, opts \\ [])

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

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

protocol_error(msg, opts \\ [])

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

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

query_argument_error(msg, opts \\ [])

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

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

query_assertion_error(msg, opts \\ [])

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

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

query_error(msg, opts \\ [])

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

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

query_timeout_error(msg, opts \\ [])

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

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

reconnect?(exception)

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

Check if should try to reconnect to Gel 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 Gel.Error with Gel.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 Gel.Error with Gel.SchemaDefinitionError type.

schema_error(msg, opts \\ [])

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

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

schema_syntax_error(msg, opts \\ [])

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

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

server_blocked_error(msg, opts \\ [])

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

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

server_offline_error(msg, opts \\ [])

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

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

session_timeout_error(msg, opts \\ [])

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

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

state_mismatch_error(msg, opts \\ [])

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

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

transaction_conflict_error(msg, opts \\ [])

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

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

transaction_deadlock_error(msg, opts \\ [])

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

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

transaction_error(msg, opts \\ [])

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

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

transaction_serialization_error(msg, opts \\ [])

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

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

transaction_timeout_error(msg, opts \\ [])

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

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

type_spec_not_found_error(msg, opts \\ [])

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

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

unexpected_message_error(msg, opts \\ [])

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

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

unknown_argument_error(msg, opts \\ [])

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

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

unknown_database_error(msg, opts \\ [])

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

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

unknown_module_error(msg, opts \\ [])

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

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

unknown_parameter_error(msg, opts \\ [])

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

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

unknown_property_error(msg, opts \\ [])

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

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

unknown_tenant_error(msg, opts \\ [])

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

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

unknown_user_error(msg, opts \\ [])

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

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

unsupported_backend_feature_error(msg, opts \\ [])

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

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

unsupported_capability_error(msg, opts \\ [])

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

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

unsupported_feature_error(msg, opts \\ [])

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

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

unsupported_protocol_version_error(msg, opts \\ [])

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

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

warning_message(msg, opts \\ [])

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

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

watch_error(msg, opts \\ [])

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

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