X Tutup
Skip to content

Changed promises to handle exceptions#529

Merged
jh0ker merged 1 commit intopython-telegram-bot:masterfrom
thodnev:promises-with-exceptions
Feb 27, 2017
Merged

Changed promises to handle exceptions#529
jh0ker merged 1 commit intopython-telegram-bot:masterfrom
thodnev:promises-with-exceptions

Conversation

@thodnev
Copy link
Copy Markdown
Member

@thodnev thodnev commented Feb 26, 2017

  • Now Promise saves exception in instance if caught, and reraises it when Promise's result is get, instead of rerasing it during run (possibly even in unknown thread)

  • __call__ method added to Promise, so now promises look more like normal callables and are more convenient to use (old run method saved for backwards-compat.)

  • Promises handling changed in Dispatcher, so that now dispatcher just runs promises and doesn't need to deal with any possible exceptions as it's work of Promise. Earlier it just logged that something went wrong in case of exceptions.

  • Promise handling logic is changed in ConversationHandler, assuming that changed promise may now raise exceptions on res, in that case logger is used for handling

These changes are 1st step on the way to introducing MessageQueue. Had a conversation with @jh0ker about this change proposal

Test results are added below.
test_results.txt

@jh0ker jh0ker merged commit fb37877 into python-telegram-bot:master Feb 27, 2017
jh0ker added a commit that referenced this pull request Feb 27, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup