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

Handle Exceptions in building CallbackContext #4222

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Bibo-Joshi
Copy link
Member

@Bibo-Joshi Bibo-Joshi commented Apr 25, 2024

Explicitly catches and logs exceptions in creating Callback context objects. Relevant particularly if the user uses a custom class that overrides from_update. Since from_error calls from_update, exceptions in from_update can currently completely shut down update processing and error handling. See https://t.me/pythontelegrambottalk/253238 for reference.
Work in progress, e.g. tests are still missing.

@Bibo-Joshi Bibo-Joshi marked this pull request as ready for review April 26, 2024 08:51
Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

interesting edge case scenario

telegram/ext/_application.py Show resolved Hide resolved
telegram/ext/_jobqueue.py Show resolved Hide resolved
tests/ext/test_application.py Show resolved Hide resolved
tests/ext/test_application.py Show resolved Hide resolved
tests/ext/test_jobqueue.py Outdated Show resolved Hide resolved
tests/ext/test_jobqueue.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants