All errors received by Kuzzle clients are
Kuzzle error has the following properties:
|integer||HTTP like status code. In most cases, will be the same as the response one.|
|text||Short description of the error|
|text||Available in development mode only - Kuzzle stack trace that generated the error|
Clients can detect the error type based on their
status and decide which action to take accordingly.
BadRequestError is thrown if Kuzzle was unable to process the action due to a malformed request.
BadRequestError objects can for instance be received if a mandatory parameter is missing or if its type is incorrect.
ExternalServiceError is thrown if Kuzzle was unable to process the action due to some external service failure (i.e. database).
ForbiddenError is thrown if the requested action is not authorized for the current authenticated user.
GatewayTimeoutError is thrown if Kuzzle is too long to respond.
InternalError is thrown if Kuzzle encountered a severe unknown error.
NotFoundError is thrown if the requested resource could not be found, like, for instance, when calling
document/get on a non-existing id.
PartialError is thrown if Kuzzle was unable to process a subset of a multi-actions requests.
PartialError can be generated, for instance, if one or several queries inside a
bulk/import request failed.
The detail of each failure can be retrieved using the
errors property of the error object.
|integer||number of failures encountered|
|array or ||Detailed errors of the failed actions|
PluginImplementationError is thrown if Kuzzle encountered a severe unknown error issued by a plugin.
PreconditionError is thrown if Kuzzle was not able to process the request due to an invalid state.
This error can for instance be generated when trying to create a document on a non-existing collection.
ServiceUnavailableError can be sent by Kuzzle proxy if no Kuzzle instance is found to process the request.
SizeLimitError is thrown by Kuzzle if the request size exceeds the limits defined in the proxy configuration.
UnauthorizedError is thrown by Kuzzle if the permissions could not be verified for the request.
UnauthorizedError will be generated for a restricted action if the client is not authentified yet.