import { ValidationErrorItem } from 'joi' ; import * as HTTP_STATUS from 'http-status' ; import { IError , IHTTPError } from '@interfaces' ; import { TypeplateError } from '@errors' ; /**
 * Type upload error
 */ export class ValidationError extends TypeplateError implements IHTTPError { description statusCode : number ; description statusText : string ; description errors : Array < string > ; constructor ( error ) { super ( 'A validation error was occurred' ) ; this . statusCode = 400 ; this . statusText = 'Validation failed' ; this . errors = this . convertError ( error . details ) ; } description param errors private convertError ( errors ) { return errors . map ( ( err ) => err . message . replace ( /"/g , '\'' ) ) ; } }