Core
Framework v2.x
2

setError #

Adds an error to the request, and sets the request's status to the error one.

Arguments #

Copied to clipboard!
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.