Added new error code (429 - too many requests)
All checks were successful
Build / Publish Docs (push) Successful in 49s
Build / Build NPM Project (push) Successful in 1m3s
Build / Tag Version (push) Successful in 9s

This commit is contained in:
2026-01-17 13:20:55 -05:00
parent 1b5e16ae5f
commit 367b026cea
2 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@ztimson/utils", "name": "@ztimson/utils",
"version": "0.28.5", "version": "0.28.6",
"description": "Utility library", "description": "Utility library",
"author": "Zak Timson", "author": "Zak Timson",
"license": "MIT", "license": "MIT",

View File

@@ -113,6 +113,18 @@ export class NotAcceptableError extends CustomError {
} }
} }
export class TooManyRequestsError extends CustomError {
static code = 429;
constructor(message: string = 'Rate Limit Reached') {
super(message);
}
static instanceof(err: Error) {
return (<any>err).constructor.code == this.code;
}
}
export class InternalServerError extends CustomError { export class InternalServerError extends CustomError {
static code = 500; static code = 500;