diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py index bdf14e0a920..30635e40ada 100644 --- a/telegram/ext/_updater.py +++ b/telegram/ext/_updater.py @@ -763,7 +763,6 @@ async def do_action() -> bool: _LOGGER.exception("Invalid token; aborting") raise except TelegramError as telegram_exc: - _LOGGER.exception("Error while %s:", description) on_err_cb(telegram_exc) # increase waiting times on subsequent errors up to 30secs diff --git a/tests/ext/test_updater.py b/tests/ext/test_updater.py index f7216100836..84a86c988da 100644 --- a/tests/ext/test_updater.py +++ b/tests/ext/test_updater.py @@ -571,7 +571,7 @@ async def get_updates(*args, **kwargs): else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records ) @@ -593,7 +593,7 @@ async def get_updates(*args, **kwargs): else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records )