Remove surplus logging from updater network loop #4432
Merged
+2
β3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
When there's a
TelegramErrorin theUpdater._network_loop_retrymethod, the exception is currently both logged and passed to theon_err_cb.Example log:
2024-08-18 03:11:51.704 ERROR (MainThread) [telegram.ext.Updater] Error while getting Updates: Bad Gateway 2024-08-18 03:11:51.704 ERROR (MainThread) [telegram.ext.Updater] Exception happened while polling for updates. Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/telegram/ext/_updater.py", line 742, in _network_loop_retry if not await do_action(): ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/ext/_updater.py", line 736, in do_action return action_cb_task.result() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/ext/_updater.py", line 387, in polling_action_cb raise exc File "/usr/local/lib/python3.12/site-packages/telegram/ext/_updater.py", line 376, in polling_action_cb updates = await self.bot.get_updates( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/_bot.py", line 541, in decorator result = await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/_bot.py", line 4177, in get_updates await self._post( File "/usr/local/lib/python3.12/site-packages/telegram/_bot.py", line 629, in _post return await self._do_post( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/_bot.py", line 657, in _do_post return await request.post( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/request/_baserequest.py", line 200, in post result = await self._request_wrapper( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/telegram/request/_baserequest.py", line 383, in _request_wrapper raise NetworkError(description or "Bad Gateway") telegram.error.NetworkError: Bad GatewayProposed changes