@ztimson/utils 0.28.5 → 0.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors.d.ts +5 -0
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/errors.d.ts
CHANGED
|
@@ -43,6 +43,11 @@ export declare class NotAcceptableError extends CustomError {
|
|
|
43
43
|
constructor(message?: string);
|
|
44
44
|
static instanceof(err: Error): boolean;
|
|
45
45
|
}
|
|
46
|
+
export declare class TooManyRequestsError extends CustomError {
|
|
47
|
+
static code: number;
|
|
48
|
+
constructor(message?: string);
|
|
49
|
+
static instanceof(err: Error): boolean;
|
|
50
|
+
}
|
|
46
51
|
export declare class InternalServerError extends CustomError {
|
|
47
52
|
static code: number;
|
|
48
53
|
constructor(message?: string);
|
package/dist/index.cjs
CHANGED
|
@@ -1507,6 +1507,15 @@ ${opts.message || this.desc}`;
|
|
|
1507
1507
|
return err.constructor.code == this.code;
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
|
+
class TooManyRequestsError extends CustomError {
|
|
1511
|
+
static code = 429;
|
|
1512
|
+
constructor(message = "Rate Limit Reached") {
|
|
1513
|
+
super(message);
|
|
1514
|
+
}
|
|
1515
|
+
static instanceof(err) {
|
|
1516
|
+
return err.constructor.code == this.code;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1510
1519
|
class InternalServerError extends CustomError {
|
|
1511
1520
|
static code = 500;
|
|
1512
1521
|
constructor(message = "Internal Server Error") {
|
|
@@ -2737,6 +2746,7 @@ ${err.message || err.toString()}`);
|
|
|
2737
2746
|
exports2.ServiceUnavailableError = ServiceUnavailableError;
|
|
2738
2747
|
exports2.Table = Table;
|
|
2739
2748
|
exports2.TemplateError = TemplateError;
|
|
2749
|
+
exports2.TooManyRequestsError = TooManyRequestsError;
|
|
2740
2750
|
exports2.TypedEmitter = TypedEmitter;
|
|
2741
2751
|
exports2.UnauthorizedError = UnauthorizedError;
|
|
2742
2752
|
exports2.addUnique = addUnique;
|