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
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelpfulZodValidationError = void 0;
class HelpfulZodValidationError 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.HelpfulZodValidationError = HelpfulZodValidationError;
//# sourceMappingURL=HelpfulZodValidationError.js.map