diff --git a/utils/gcp_pubsub_service.py b/utils/gcp_pubsub_service.py index bd1a53f147c..2c7d3bc5c1e 100644 --- a/utils/gcp_pubsub_service.py +++ b/utils/gcp_pubsub_service.py @@ -340,16 +340,15 @@ def process_message(self, message: Any): # Retry download once with fresh client if TransportError/SSL issues occur success = False for attempt in range(2): - try: - if download_from_gcs(gcs_uri, temp_path, logger=mlog, client=self.storage_client): - success = True - break - except Exception as e: + if download_from_gcs(gcs_uri, temp_path, logger=mlog, client=self.storage_client): + success = True + break + else: if attempt == 0: - mlog.warning("Transient error during download, recreating client and retrying: %s", e) + mlog.warning("Transient error during download, recreating client and retrying") self._init_clients() else: - mlog.error("Persistent error during download: %s", e) + mlog.error("Persistent error during download after retries") if success: mlog.info("Download finished in %.2f seconds", time.time() - dl_start)