NotFoundErrorclass
new NotFoundError(message?: string, options?: RequestErrorOptions)
| Param | Type | |
|---|---|---|
message | string | Optional human-readable description of what was not found. |
options | RequestErrorOptions | 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
codeto404.
Examples
throw new NotFoundError("User does not exist");