UNPKG

336 BPlain TextView Raw
1import type {ErrorObject} from "../types"
2
3export default class ValidationError extends Error {
4 readonly errors: Partial<ErrorObject>[]
5 readonly ajv: true
6 readonly validation: true
7
8 constructor(errors: Partial<ErrorObject>[]) {
9 super("validation failed")
10 this.errors = errors
11 this.ajv = this.validation = true
12 }
13}