UnprocessableErrorclass

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

Examples

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