chargebee
Version:
A library for integrating with Chargebee.
19 lines (18 loc) • 810 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChargebeeZodValidationError = void 0;
class ChargebeeZodValidationError extends Error {
constructor(actionName, zodError) {
var _a;
const messages = zodError.issues
.map((e) => `${e.path.join('.')}: ${e.message}`)
.join('; ');
super(`[Chargebee] Validation failed for '${actionName}': ${messages}`);
Object.setPrototypeOf(this, new.target.prototype);
this.name = 'ChargebeeZodValidationError';
this.actionName = actionName;
this.zodError = zodError;
(_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, this.constructor);
}
}
exports.ChargebeeZodValidationError = ChargebeeZodValidationError;