UnprocessableErrorclass

new UnprocessableError(message?: string, options?: RequestErrorOptions)
ParamType
messagestring
Optional human-readable description of why the data could not be processed.
optionsRequestErrorOptions
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 code to 422.

Examples

throw new UnprocessableError("Email address is invalid");