From 343e1d5ac2ce810a8c48288401859837c63eca92 Mon Sep 17 00:00:00 2001 From: Pymetheus Date: Fri, 22 May 2026 12:07:47 +0200 Subject: [PATCH] fix: disambiguate exception imports in Bluesky client Avoid a name collision between atproto_client and httpx exceptions by aliasing atproto_client.exceptions.InvokeTimeoutError and NetworkError to AtprotoInvokeTimeoutError and AtprotoNetworkError, and update the except clause to catch those aliases. This ensures the BlueskyAPIClient correctly handles atproto client timeouts and network errors without confusing them with httpx.NetworkError. --- src/pimetheus/integrations/publish/bluesky/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pimetheus/integrations/publish/bluesky/client.py b/src/pimetheus/integrations/publish/bluesky/client.py index b3dca0c..0d7f027 100644 --- a/src/pimetheus/integrations/publish/bluesky/client.py +++ b/src/pimetheus/integrations/publish/bluesky/client.py @@ -4,7 +4,8 @@ import structlog from atproto import Client -from atproto_client.exceptions import InvokeTimeoutError +from atproto_client.exceptions import InvokeTimeoutError as AtprotoInvokeTimeoutError +from atproto_client.exceptions import NetworkError as AtprotoNetworkError from httpx import NetworkError from pimetheus.utils.config import Settings @@ -53,7 +54,7 @@ def execute_with_retry(self, function: Callable[[], T], *, action: str) -> T: logger.info("Executing API call", action=action, attempt=attempt + 1) try: return function() - except (InvokeTimeoutError, NetworkError) as e: + except (AtprotoInvokeTimeoutError, AtprotoNetworkError) as e: logger.warning("API call failed", action=action) last_exception = e