Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1214 by adding more info in the ratelimited error exception message #1312

Merged
merged 2 commits into from
Aug 18, 2021

Conversation

seratch
Copy link
Member

@seratch seratch commented Aug 18, 2021

Summary

This pull request fixes #1214 by updating the Error thrown in the case where the WebClient receives a ratelimited error rom the server-side.

Requirements (place an x in each [ ])

@seratch seratch added enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` labels Aug 18, 2021
@seratch seratch added this to the web-api@6.4 milestone Aug 18, 2021
Copy link
Member

@srajiang srajiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the url and retrySec to the error thrown sounds like a good start, and I like that the TODO comments lets others pick up the thread in future if they feel more information would be helpful.

} else {
// TODO: turn this into some CodedError
throw new AbortError(new Error('Retry header did not contain a valid timeout.'));
throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url})`));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srajiang @stevengill
Sorry for changes after the reviews but I just updated this one as well. It should be fine too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks fine!

@seratch seratch merged commit 7b95663 into slackapi:main Aug 18, 2021
@seratch seratch deleted the issue-1214-rate-limit-error-info branch August 18, 2021 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More detailed information for ratelimited errors from WebClient
3 participants