@squarecloud/api
Version:
A NodeJS wrapper for Square Cloud API
18 lines • 541 B
JavaScript
// src/structures/error.ts
var SquareCloudAPIError = class extends TypeError {
constructor(code, message, options) {
super(code);
this.name = "SquareCloudAPIError";
this.message = (code?.replaceAll("_", " ").toLowerCase().replace(/(^|\s)\S/g, (L) => L.toUpperCase()) || "UNKNOWN_CODE") + (message ? `: ${message}` : "");
if (options?.stack) {
this.stack = options.stack;
}
if (options?.cause) {
this.cause = options.cause;
}
}
};
export {
SquareCloudAPIError
};
//# sourceMappingURL=error.js.map