import { RestError } from '../rest-error' ; import { ValidationFailureItem } from './validation-failure-item' ; export class ValidationFailureError extends RestError { constructor ( public failures = [ ] , public message = 'Validation of request body failed.' ) { super ( message , 400 , 'VALIDATION_FAILURE' ) ; this . name = 'ValidationFailureError' ; } toJSON ( ) { return { code : this . code , message : this . message , failures : this . failures } ; } }