code | type | title | meta | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
page |
errors | Protocol Framework | Write protocols | Guide |
|
The context.errors
object regroups all error objects, used in request responses, or to be used by the protocol if needs be.
Inherits from the standard Javascript Error
object: abstract class inherited by all Kuzzle error objects.
This class should only be used to create new Kuzzle error objects.
Properties | Type | Description |
---|---|---|
message |
string |
Error message |
stack |
string[] |
Error stack trace (not available in production mode) |
status |
integer |
Error status code, following the standard HTTP status code |
Invalid request syntax.
400
const err = new context.errors.BadRequestError('error message');
External service failure.
500
const err = new context.errors.ExternalServiceError('error message');
Unauthorized access to a resource.
403
const err = new context.errors.ForbiddenError('error message');
Timeout error.
504
const err = new context.errors.GatewayTimeoutError('error message');
Unexpected error. Should be reserved for Kuzzle's use only.
500
const err = new context.errors.InternalError('error message');
Resource not found.
404
const err = new context.errors.NotFoundError('error message');
400
const err = new context.errors.ParseError('error message');
Partial request success.
new context.error.PartialError(message, errors);
Arguments | Type | Description |
---|---|---|
message |
string |
Error message |
failures |
KuzzleError[] |
List of encountered errors |
206
const err = new context.errors.PartialError('error message', [
new context.errors.BadRequestError('[request part] invalid format'),
new context.errors.ForbiddenError('[other request part] forbidden')
]);
Unexpected plugin failure.
500
const err = new context.errors.PluginImplementationError('error message');
Unmet request prerequisites.
412
const err = new context.errors.PreconditionError('error message');
Temporarily unable to respond.
503
const err = new context.errors.ServiceUnavailableError('error message');
KuzzleRequest exceeds the maximum limits.
413
const err = new context.errors.SizeLimitError('error message');
Authentication failed.
401
const err = new context.errors.UnauthorizedError('error message');