From 7370f6c94daff9d7d85ac83f6f94980cf2f201d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Gr=C3=A4tz?= Date: Fri, 19 Jul 2024 23:50:34 +0200 Subject: [PATCH] Fix: Properly re-raise non-grpc exceptions during refreshing of proxy-auth credentials in auth interceptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio Grätz --- flytekit/clients/grpc_utils/auth_interceptor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flytekit/clients/grpc_utils/auth_interceptor.py b/flytekit/clients/grpc_utils/auth_interceptor.py index e467801a77..6a73e0764e 100644 --- a/flytekit/clients/grpc_utils/auth_interceptor.py +++ b/flytekit/clients/grpc_utils/auth_interceptor.py @@ -61,6 +61,8 @@ def intercept_unary_unary( fut: grpc.Future = continuation(updated_call_details, request) e = fut.exception() if e: + if not hasattr(e, "code"): + raise e if e.code() == grpc.StatusCode.UNAUTHENTICATED or e.code() == grpc.StatusCode.UNKNOWN: self._authenticator.refresh_credentials() updated_call_details = self._call_details_with_auth_metadata(client_call_details)