-
Notifications
You must be signed in to change notification settings - Fork 853
Description
Hello!
I am implementing a Slack app, and I am trying to implement correct backoff handling for when Slack reports my app has exceeded rate limits.
The example in the docs says you can notice that you are being rate limited with this snippet:
try:
response = send_slack_message(channel, message)
except SlackApiError as e:
if e.response["error"] == "ratelimited":
...The method in question is chat.postMessage. However, the documentation for the errors of that method say that the rate limiting error is spelled rate_limited (with an underscore).
I clicked around at random on a few web API methods on the API docs, and I do see a mixture of ratelimited and rate_limited spellings.
The places in code (i.e. not in the docs) all seem to be calling methods that spell the error "ratelimited" (rtm.connect and apps.connections.open), so the good news is that this mostly seems to be incorrect documentation?
Maybe this is a complaint better lodged at the API itself. For my application, I'm just going to check the HTTP status code, which is what the page on rate limits recommends.
I'd be happy to send a PR for the docs, but I'm wondering what you'd consider the best approach: should the docs check the HTTP status code instead of the error message? Should the docs suggest rate_limited when calling chat.postMessage (as in the snippet above)?
Thanks!