Documentation / @zerotal/validator / ValidationJsonError
Class: ValidationJsonError
Defined in: validator/src/ValidationError.ts:29
Thrown by validate() when validation fails and the request is a JSON API request (Accept: application/json, no X-Inertia header).
The global exception handler in @zerotal/core catches this by checking err?.name === 'ValidationJsonError' and returns a 422 response.
Extends
Constructors
Constructor
new ValidationJsonError(
errors):ValidationJsonError
Defined in: validator/src/ValidationError.ts:32
Parameters
errors
Returns
ValidationJsonError
Overrides
Properties
code
readonlycode:string
Defined in: core/src/errors/ZerotalError.ts:18
Inherited from
status
readonlystatus:number=500
Defined in: core/src/errors/ZerotalError.ts:19
Inherited from
context?
readonlyoptionalcontext?:Record<string,unknown>
Defined in: core/src/errors/ZerotalError.ts:20
Inherited from
name
readonlyname:"ValidationJsonError"="ValidationJsonError"
Defined in: validator/src/ValidationError.ts:30
Overrides
ZerotalError.name
errors
readonlyerrors:ValidationErrors
Defined in: validator/src/ValidationError.ts:32