Currently, we do something like
try:
dispatcher.dispatch_error(exception)
except:
logger.execption(…)
everywhere, where we call dispatcher.dispatch_error, leading to some code repetition. I propose to instead move that logic directly into Dispatcher.dispatch_error. The only downside of this would be that currently log message in line 4 above can contain some explicit hint on where the exception happened, but one can also just read the traceback …
Edit: This would also cover cases where some CustomContext.from_* raises an exception, see the discussion at https://t.me/c/1494805131/17428