This commit is contained in:
Tiberiu Potec 2023-07-30 23:20:11 +05:00 committed by GitHub
commit 0dd19e38a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -415,8 +415,16 @@ class AsyncTeleBot:
except asyncio.CancelledError:
return
except asyncio_helper.RequestTimeout as e:
logger.error(str(e))
if non_stop:
handled = False
if self.exception_handler:
self.exception_handler.handle(e)
handled = True
if not handled:
logger.error('Unhandled exception (full traceback for debug level): %s', str(e))
logger.debug(traceback.format_exc())
if non_stop or handled:
await asyncio.sleep(2)
continue
else: