Core
API v2.x
2

Error #

Errors returned by the Kuzzle API in the error part of a response are objects with the following properties:

PropertyTypeDescription
status
number
HTTP status code
message
string
Short description of the error
stack
string
Error stack trace (Available in development mode only)
id
string
Error unique identifier
code
number
Error unique code
props
string[]
Array of placeholders used to construct the error message. Can be used to construct new errors.

id #

The id property is unique to each type of error that can be returned, and is built by concatenating the following information:

  • Domain: from where the error comes from (API, network, plugin, ...)
  • Subdomain: what kind of error it is (assertion, runtime, ...)
  • Error: the error itself

For instance:

  • api.assert.missing_argument is an assertion error triggered by the API because of a missing argument
  • network.http.url_not_found is a HTTP error triggered by the network layer, because a requested URL couldn't be found

The complete list of API errors is available here.


code #

The code property is a 32-bits integer representation of the unique id error identifier, detailed above.

It's meant to be used by low-level languages to efficiently catch specific error codes and act on them.

Code format:

  • Domain: ranges from 00 to FF (1 byte)
  • Subdomain: ranges from 00 to FF (1 byte)
  • Error: ranges from 0000 to FFFF (2 bytes)

The complete list of API errors is available here.