domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
21 lines (20 loc) • 825 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelpfulYupValidationError = void 0;
const HelpfulSchemaValidationError_1 = require("./HelpfulSchemaValidationError");
class HelpfulYupValidationError extends HelpfulSchemaValidationError_1.HelpfulSchemaValidationError {
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