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

Update error handling in slack module #31

Merged
merged 2 commits into from
May 1, 2024

Conversation

sam57719
Copy link
Collaborator

Swapped from using a list "ERRORS_TO_IGNORE" to a dictionary "ERROR_STATUSES" to handle error types more flexibly in the Slack module. Now, instead of simply ignoring certain errors, they are associated with appropriate HTTP status codes in the new dictionary.

Any BoltUnhandledRequestError will now return a 404
Any Unhandled Exception in a plugin will return a 418 (I'm a TEAPOT)

Swapped from using a list "ERRORS_TO_IGNORE" to a dictionary "ERROR_STATUSES" to handle error types more flexibly in the Slack module. Now, instead of simply ignoring certain errors, they are associated with appropriate HTTP status codes in the new dictionary.

Any BoltUnhandledRequestError will now return a 404
Any Unhandled Exception in a plugin will return a 418 (I'm a TEAPOT)
@sam57719 sam57719 linked an issue Apr 25, 2024 that may be closed by this pull request
@sjefferson99 sjefferson99 self-assigned this Apr 28, 2024
smib/slack/error.py Outdated Show resolved Hide resolved
The existing code that handled errors was refactored for better readability and efficiency. The class of the error is now captured in a variable, which is then used for logging and creating an appropriate response for unhandled error cases.
@sjefferson99 sjefferson99 merged commit 231807f into develop May 1, 2024
@sjefferson99 sjefferson99 deleted the 25-only-return-200-when-successful branch May 1, 2024 18:03
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.

Only return 200 when successful
2 participants