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 authored and seratch committed Mar 12, 2024
1 parent 20899b0 commit 8bff32f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-api/src/WebClient.ts
Original file line number Diff line number Diff line change
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 8bff32f

Please sign in to comment.