setError #
Adds an error to the request, and sets the request's status to the error one.
Arguments #
setError(error: Error): void;
Name | Type | Description |
---|---|---|
error | Error | Error object to set |
If a KuzzleError
is provided, the request's status attribute is set to the error one.
Otherwise, the provided error is encapsulated into an InternalError
object, and the request's status is set to 500.
Edit this page on Github (opens new window)