diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index d2808ec..8e76e7d 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -14,7 +14,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.2.7" +__version__ = "2.2.8" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/api.py b/davtelepot/api.py index 19f6a2a..6e168fb 100644 --- a/davtelepot/api.py +++ b/davtelepot/api.py @@ -298,12 +298,15 @@ class TelegramBot(object): "request" ) self.set_flood_wait(flood_wait) - return e + response_object = e except Exception as e: logging.error(f"{e}", exc_info=True) - return e + response_object = e except asyncio.TimeoutError as e: logging.info(f"{e}: {method} API call timed out") + except Exception as e: + logging.info(f"Unexpected eception:\n{e}") + response_object = e finally: if session_must_be_closed and not session.closed: await session.close()