mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
added posibility to handle exception on RequestTimeout
This commit is contained in:
parent
0f52ca688f
commit
ebfbfb2dfc
@ -415,8 +415,16 @@ class AsyncTeleBot:
|
|||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
return
|
return
|
||||||
except asyncio_helper.RequestTimeout as e:
|
except asyncio_helper.RequestTimeout as e:
|
||||||
logger.error(str(e))
|
handled = False
|
||||||
if non_stop:
|
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)
|
await asyncio.sleep(2)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user