UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

20 lines (19 loc) 689 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HelpfulYupValidationError = void 0; class HelpfulYupValidationError extends Error { constructor({ error, props, domainObject, }) { const message = ` Errors were found while validating properties for domain object ${domainObject}.: ${JSON.stringify(error.errors, null, 2)} Props Provided: ${JSON.stringify(props, null, 2)} `.trim(); super(message); this.details = error.errors; this.props = props; this.domainObject = domainObject; } } exports.HelpfulYupValidationError = HelpfulYupValidationError; //# sourceMappingURL=HelpfulYupValidationError.js.map