skyflow-node
Version:
Skyflow SDK for Node.js
22 lines • 806 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const logs_helper_1 = require("../utils/logs-helper");
class SkyflowError extends Error {
constructor(errorCode, args, isSingularError = false) {
const formattedError = {
code: errorCode.code,
description: (args && (args === null || args === void 0 ? void 0 : args.length) > 0)
? (0, logs_helper_1.parameterizedString)(errorCode.description, ...args)
: errorCode.description,
};
super(formattedError.description);
if (isSingularError) {
this.error = formattedError;
}
else {
this.errors = [formattedError];
}
}
}
exports.default = SkyflowError;
//# sourceMappingURL=SkyflowError.js.map