validation_error.ts 336 B

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