Skip to content

Conversation

@greysteil
Copy link
Contributor

@greysteil greysteil commented Mar 9, 2025

Currently, this library throws a strconv.NumError when attempting to post messages to a Slack workspace that has exceeded its message limit. It does so because Slack returns a 429 without a Retry-After header for those requests.

This PR improves the situation by instead returning a StatusCodeError. I couldn't see any obvious way to provide a more detailed error without creating a new error class. To only additional information returned from Slack for these errors is a body that reads message_limit_exceeded.

Copy link
Collaborator

@nlopes nlopes left a comment

Choose a reason for hiding this comment

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

Thanks @greysteil! This should go out with 0.17 which hopefully I'll release soon.

@nlopes nlopes self-assigned this Mar 10, 2025
@nlopes
Copy link
Collaborator

nlopes commented Mar 10, 2025

@greysteil I think you'll need to change the testing endpoint as websocket2 is already in use by another test.

@greysteil greysteil force-pushed the handle-message-limit-exceeded branch from ae402a1 to e356192 Compare March 10, 2025 12:13
@greysteil
Copy link
Contributor Author

@nlopes - updated!

@nlopes nlopes merged commit 1e1dbbf into slack-go:master Mar 10, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants