Error #
Errors returned by the Kuzzle API in the error
part of a response are objects with the following properties:
Property | Type | Description |
---|---|---|
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 argumentnetwork.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
toFF
(1 byte) - Subdomain: ranges from
00
toFF
(1 byte) - Error: ranges from
0000
toFFFF
(2 bytes)
The complete list of API errors is available here.
Edit this page on Github(opens new window)