import { RestError } from '../rest-error' ; import { ValidationFailureItem } from './validation-failure-item' ; export class BusinessViolationError extends RestError { constructor ( public businessViolationCode , public message = 'A business rule has been violated.' ) { super ( message , 422 , 'BUSINESS_VIOLATION' ) ; this . name = 'BusinessViolationError' ; } toJSON ( ) { return { code : this . code , businessViolationCode : this . businessViolationCode , message : this . message } ; } }