UnprocessableErrorclass
new UnprocessableError(message?: string, options?: RequestErrorOptions)
| Param | Type | |
|---|---|---|
message | string | Optional human-readable description of why the data could not be processed. |
options | RequestErrorOptions | Optional options — code defaults to 422; caller and contextual fields are applied via setBaseErrorOptions(). |
| Return | |
|---|---|
UnprocessableError | Throw when a request is valid and well-formed, but its actual data is not. |
Throw when a request is valid and well-formed, but its actual data is not.
- Sets HTTP status
codeto422.
Examples
throw new UnprocessableError("Email address is invalid");