UNPKG

@nestjs-mod/common

Version:

A collection of utilities for unifying NestJS applications and modules

21 lines 875 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigModelValidationErrors = void 0; /** * Error thrown when configuration model validation fails * Contains both the validation errors and metadata info for debugging */ class ConfigModelValidationErrors extends Error { constructor(errors, info, message) { const defaultMessage = Object.entries(info.validations) .filter(([key, _value]) => errors.some((err) => err.property === key)) .map(([key, value]) => `${key}-${Object.keys(value.constraints || {}).join(',')}`) .join(';'); super(message || defaultMessage); this.name = 'ConfigModelValidationErrors'; this.errors = errors; this.info = info; } } exports.ConfigModelValidationErrors = ConfigModelValidationErrors; //# sourceMappingURL=errors.js.map