UNPKG

@amirmarmul/waba-common

Version:

![GitHub release](https://img.shields.io/github/v/release/amirmarmul/waba-common?style=flat-square)

20 lines (19 loc) 554 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValidationError = void 0; const AppError_1 = require("../../core/errors/AppError"); class ValidationError extends AppError_1.AppError { errors; constructor(errors) { super('Unprocessable Content', 422); this.errors = errors; } static with(error) { return new ValidationError([error]); } serializeErrors() { return this.errors; } } exports.ValidationError = ValidationError; exports.default = ValidationError;