NotFoundErrorclass

new NotFoundError(message?: string, options?: RequestErrorOptions)
ParamType
messagestring
Optional human-readable description of what was not found.
optionsRequestErrorOptions
Optional options — code defaults to 404; caller and contextual fields are applied via setBaseErrorOptions().
Return
NotFoundError
Throw if the requested content is not found.

Throw if the requested content is not found.

  • Sets HTTP status code to 404.

Examples

throw new NotFoundError("User does not exist");