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

Centralize error handling #205

Merged
merged 6 commits into from
Mar 18, 2024
Merged

Centralize error handling #205

merged 6 commits into from
Mar 18, 2024

Conversation

shtlrs
Copy link
Member

@shtlrs shtlrs commented Feb 18, 2024

Closes #198

This is the first implementation of all the needed abstractions for the error handling in our bots.
All the necessary details will be found in the linked issue's description.

Copy link

netlify bot commented Feb 18, 2024

Deploy Preview for bot-core ready!

Name Link
🔨 Latest commit dfda554
🔍 Latest deploy log https://app.netlify.com/sites/bot-core/deploys/65f82e2be3b73a000877ef8d
😎 Deploy Preview https://deploy-preview-205--bot-core.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shtlrs shtlrs requested a review from ChrisLovering February 18, 2024 20:58
@shtlrs shtlrs requested review from MarkKoz and mbaruh March 11, 2024 05:45
pydis_core/utils/error_handling/commands/abc.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
pydis_core/utils/error_handling/commands/manager.py Outdated Show resolved Hide resolved
@shtlrs shtlrs requested a review from MarkKoz March 11, 2024 23:53
@shtlrs
Copy link
Member Author

shtlrs commented Mar 11, 2024

@MarkKoz I've pushed two commits that address your comments, I'll squash them into the main ones later.

@shtlrs shtlrs force-pushed the better-error-handling branch from 39c4003 to 7d9cb68 Compare March 12, 2024 07:44
shtlrs added 6 commits March 18, 2024 11:37
This also moves the handle_forbidden_from_block util to the package's ctor to ensure backwards compat
this represents an interface that all command handlers will need to implement in order to be able to use them in both app & text command errors
The purpose is to register the handlers in one place, which will allow us to delegate the choosing of the right handler & handling to the manager
this subclass will be calling the error manager upon error
The manager instance needs to be bound "late" due to the bot since error handlers might need an instance of bot to work
@shtlrs shtlrs force-pushed the better-error-handling branch from 7d9cb68 to dfda554 Compare March 18, 2024 12:06
@ChrisLovering ChrisLovering merged commit dfda554 into main Mar 18, 2024
8 checks passed
@ChrisLovering ChrisLovering deleted the better-error-handling branch March 18, 2024 12:18
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.

Centralize error handling
3 participants