Skip to content

Commit 8bff32f

Browse files
WhiteKiwiseratch
authored andcommittedMar 12, 2024
web-api(fix): Fix typo in error throwing for rate limit exceeded
1 parent 20899b0 commit 8bff32f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/web-api/src/WebClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export class WebClient extends Methods {
594594
// resume the request queue and throw a non-abort error to signal a retry
595595
this.requestQueue.start();
596596
// TODO: We may want to have more detailed info such as team_id, params except tokens, and so on.
597-
throw Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
597+
throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
598598
} else {
599599
// TODO: turn this into some CodedError
600600
throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));

0 commit comments

Comments
 (0)
Please sign in to comment.