Periodically, I see errors like ConnectionResetError: An existing connection was forcibly closed by the remote host
in the logs. However, they are not blocking, and the bot continues further work, but I don’t understand how to catch them? If you wrap the Dispatcher().start_polling()
method in a try-except
, it does not catch them, since this happens (as I understand it) somewhere inside the aiohttp
. These errors do not essentially interfere with work, but I would like to put things in order in the log files and in the sentry
work, since these tracebacks greatly clutter up the logs