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

Fix KeyError in kill #46

Open
e-caste opened this issue Apr 29, 2020 · 0 comments
Open

Fix KeyError in kill #46

e-caste opened this issue Apr 29, 2020 · 0 comments
Labels
bug Something isn't working low priority

Comments

@e-caste
Copy link
Owner

e-caste commented Apr 29, 2020

When the bot is restarted, an error like the following can be raised when a user tries to kill a game for which there is no timer left:

2020-04-29 14:29:02,358 - __main__ - INFO - User <user> (<user_id>) killed a game in group <group> - <group_id>
2020-04-29 14:29:02,360 - telegram.ext.dispatcher - ERROR - An error was raised while processing the update and an uncaught error was raised while handling the error with an error_handler
Traceback (most recent call last):
  File "/path/venvpypy/site-packages/telegram/ext/dispatcher.py", line 403, in process_update
    self.dispatch_error(update, e)
  File "/path/venvpypy/site-packages/telegram/ext/dispatcher.py", line 528, in dispatch_error
    callback(update, CallbackContext.from_error(update, error, self))
  File "/pathvenvpypy/site-packages/telegram/ext/dispatcher.py", line 390, in process_update
    handler.handle_update(update, self, check, context)
  File "/path/venvpypy/site-packages/telegram/ext/handler.py", line 117, in handle_update
    return self.callback(update, context)
  File "/path/boggle_telegram_bot.py", line 920, in kill
    timers['newgame'][group_id]()
KeyError: <group_id>

This fix should either be implemented in the kill() function or in the __check_bot_was_restarted() function.

@e-caste e-caste added bug Something isn't working low priority labels Apr 29, 2020
@e-caste e-caste self-assigned this Apr 29, 2020
@e-caste e-caste removed their assignment Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

1 participant