sdk-javascript/src/event/validation/validation_error.ts

15 lines
392 B
TypeScript

import { ErrorObject } from "ajv";
/**
* An Error class that will be thrown when a CloudEvent
* cannot be properly validated against a specification.
*/
export class ValidationError extends TypeError {
errors?: string[] | ErrorObject[] | null;
constructor(message: string, errors?: string[] | ErrorObject[] | null) {
super(message);
this.errors = errors ? errors : [];
}
}