π The fast, Pythonic way to build MCP servers and clients.
Pass httpxerrors through
Jeremiah Lowin753afb0d303f
diff --git a/src/fastmcp/client/client.py b/src/fastmcp/client/client.pyindex 66d1099ce..96330f3bc 100644--- a/src/fastmcp/client/client.py+++ b/src/fastmcp/client/client.py@@ -294,7 +294,9 @@ class Client(Generic[ClientTransportT]):and not self._session_task.cancelled()):exception = self._session_task.exception()- if exception is not None:+ if isinstance(exception, httpx.HTTPStatusError):+ raise exception+ elif exception is not None:raise RuntimeError(f"Client failed to connect: {exception}") from exception