Errors

Errors inheritance

Each error in EdgeDB consists of a code, a name, and optionally tags. Errors in EdgeDB can inherit from other errors. This is denoted by matching code prefixes. For example, TransactionConflictError (0x_05_03_01_00) is the parent error for TransactionSerializationError (0x_05_03_01_01) and TransactionDeadlockError (0x_05_03_01_02). The matching prefix here is 0x_05_03_01.

When the EdgeDB client expects a more general error and EdgeDB returns a more specific error that inherits from the general error, the check in the client must take this into account. This can be expressed by the binary and operation or & opeator in most programming languages:

  1. (expected_error_code & server_error_code) == expected_error_code

Note that although it is not explicitly stated in the edb/api/errors.txt file, each inherited error must contain all tags of the parent error. Given that, TransactionSerializationError and TransactionDeadlockError, for example, must contain the SHOULD_RETRY tag that is defined for TransactionConflictError.

Error codes

Error codes and names as specified in edb/api/errors.txt:

  1. #
  2. # This source file is part of the EdgeDB open source project.
  3. #
  4. # Copyright 2016-present MagicStack Inc. and the EdgeDB authors.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. ####
  19. 0x_01_00_00_00 InternalServerError
  20. ####
  21. 0x_02_00_00_00 UnsupportedFeatureError
  22. ####
  23. 0x_03_00_00_00 ProtocolError
  24. 0x_03_01_00_00 BinaryProtocolError
  25. 0x_03_01_00_01 UnsupportedProtocolVersionError
  26. 0x_03_01_00_02 TypeSpecNotFoundError
  27. 0x_03_01_00_03 UnexpectedMessageError
  28. 0x_03_02_00_00 InputDataError
  29. 0x_03_02_01_00 ParameterTypeMismatchError
  30. 0x_03_02_02_00 StateMismatchError #SHOULD_RETRY
  31. 0x_03_03_00_00 ResultCardinalityMismatchError
  32. 0x_03_04_00_00 CapabilityError
  33. 0x_03_04_01_00 UnsupportedCapabilityError
  34. 0x_03_04_02_00 DisabledCapabilityError
  35. ####
  36. 0x_04_00_00_00 QueryError
  37. 0x_04_01_00_00 InvalidSyntaxError
  38. 0x_04_01_01_00 EdgeQLSyntaxError
  39. 0x_04_01_02_00 SchemaSyntaxError
  40. 0x_04_01_03_00 GraphQLSyntaxError
  41. 0x_04_02_00_00 InvalidTypeError
  42. 0x_04_02_01_00 InvalidTargetError
  43. 0x_04_02_01_01 InvalidLinkTargetError
  44. 0x_04_02_01_02 InvalidPropertyTargetError
  45. 0x_04_03_00_00 InvalidReferenceError
  46. 0x_04_03_00_01 UnknownModuleError
  47. 0x_04_03_00_02 UnknownLinkError
  48. 0x_04_03_00_03 UnknownPropertyError
  49. 0x_04_03_00_04 UnknownUserError
  50. 0x_04_03_00_05 UnknownDatabaseError
  51. 0x_04_03_00_06 UnknownParameterError
  52. 0x_04_04_00_00 SchemaError
  53. 0x_04_05_00_00 SchemaDefinitionError
  54. 0x_04_05_01_00 InvalidDefinitionError
  55. 0x_04_05_01_01 InvalidModuleDefinitionError
  56. 0x_04_05_01_02 InvalidLinkDefinitionError
  57. 0x_04_05_01_03 InvalidPropertyDefinitionError
  58. 0x_04_05_01_04 InvalidUserDefinitionError
  59. 0x_04_05_01_05 InvalidDatabaseDefinitionError
  60. 0x_04_05_01_06 InvalidOperatorDefinitionError
  61. 0x_04_05_01_07 InvalidAliasDefinitionError
  62. 0x_04_05_01_08 InvalidFunctionDefinitionError
  63. 0x_04_05_01_09 InvalidConstraintDefinitionError
  64. 0x_04_05_01_0A InvalidCastDefinitionError
  65. 0x_04_05_02_00 DuplicateDefinitionError
  66. 0x_04_05_02_01 DuplicateModuleDefinitionError
  67. 0x_04_05_02_02 DuplicateLinkDefinitionError
  68. 0x_04_05_02_03 DuplicatePropertyDefinitionError
  69. 0x_04_05_02_04 DuplicateUserDefinitionError
  70. 0x_04_05_02_05 DuplicateDatabaseDefinitionError
  71. 0x_04_05_02_06 DuplicateOperatorDefinitionError
  72. 0x_04_05_02_07 DuplicateViewDefinitionError
  73. 0x_04_05_02_08 DuplicateFunctionDefinitionError
  74. 0x_04_05_02_09 DuplicateConstraintDefinitionError
  75. 0x_04_05_02_0A DuplicateCastDefinitionError
  76. ####
  77. 0x_04_06_00_00 SessionTimeoutError
  78. 0x_04_06_01_00 IdleSessionTimeoutError
  79. 0x_04_06_02_00 QueryTimeoutError
  80. 0x_04_06_0A_00 TransactionTimeoutError
  81. 0x_04_06_0A_01 IdleTransactionTimeoutError
  82. ####
  83. 0x_05_00_00_00 ExecutionError
  84. 0x_05_01_00_00 InvalidValueError
  85. 0x_05_01_00_01 DivisionByZeroError
  86. 0x_05_01_00_02 NumericOutOfRangeError
  87. 0x_05_01_00_03 AccessPolicyError
  88. 0x_05_02_00_00 IntegrityError
  89. 0x_05_02_00_01 ConstraintViolationError
  90. 0x_05_02_00_02 CardinalityViolationError
  91. 0x_05_02_00_03 MissingRequiredError
  92. 0x_05_03_00_00 TransactionError
  93. 0x_05_03_01_00 TransactionConflictError #SHOULD_RETRY
  94. 0x_05_03_01_01 TransactionSerializationError
  95. 0x_05_03_01_02 TransactionDeadlockError
  96. ####
  97. 0x_06_00_00_00 ConfigurationError
  98. ####
  99. 0x_07_00_00_00 AccessError
  100. 0x_07_01_00_00 AuthenticationError
  101. ####
  102. 0x_08_00_00_00 AvailabilityError
  103. 0x_08_00_00_01 BackendUnavailableError #SHOULD_RETRY
  104. ####
  105. 0x_09_00_00_00 BackendError
  106. 0x_09_00_01_00 UnsupportedBackendFeatureError
  107. ####
  108. 0x_F0_00_00_00 LogMessage
  109. 0x_F0_01_00_00 WarningMessage
  110. #### Suggested errors for EdgeDB clients
  111. 0x_FF_00_00_00 ClientError
  112. 0x_FF_01_00_00 ClientConnectionError
  113. 0x_FF_01_01_00 ClientConnectionFailedError
  114. 0x_FF_01_01_01 ClientConnectionFailedTemporarilyError #SHOULD_RECONNECT #SHOULD_RETRY
  115. 0x_FF_01_02_00 ClientConnectionTimeoutError #SHOULD_RECONNECT #SHOULD_RETRY
  116. 0x_FF_01_03_00 ClientConnectionClosedError #SHOULD_RECONNECT #SHOULD_RETRY
  117. 0x_FF_02_00_00 InterfaceError
  118. 0x_FF_02_01_00 QueryArgumentError
  119. 0x_FF_02_01_01 MissingArgumentError
  120. 0x_FF_02_01_02 UnknownArgumentError
  121. 0x_FF_02_01_03 InvalidArgumentError
  122. 0x_FF_03_00_00 NoDataError
  123. 0x_FF_04_00_00 InternalClientError