Skip to content

Commit

Permalink
web-api(fix): Fix typo in error throwing for rate limit exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteKiwi committed Mar 12, 2024
1 parent 20899b0 commit 1a331c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-api/src/WebClient.ts
Expand Up @@ -594,7 +594,7 @@ export class WebClient extends Methods {
// resume the request queue and throw a non-abort error to signal a retry
this.requestQueue.start();
// TODO: We may want to have more detailed info such as team_id, params except tokens, and so on.
throw Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
} else {
// TODO: turn this into some CodedError
throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));
Expand Down

0 comments on commit 1a331c8

Please sign in to comment.