From bf56e69859fb7b494e03bd772f4d2278a16e4145 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Tue, 26 Nov 2024 11:06:40 +0000 Subject: [PATCH] docs: fix requests.HTTPError -> httpx.HTTPError This fixes #44. --- docs/first-server/python.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/first-server/python.mdx b/docs/first-server/python.mdx index 12559a1..7a1c42c 100644 --- a/docs/first-server/python.mdx +++ b/docs/first-server/python.mdx @@ -247,7 +247,7 @@ Let's build your first MCP server in Python! We'll create a weather server that text=json.dumps(forecasts, indent=2) ) ] - except requests.HTTPError as e: + except httpx.HTTPError as e: logger.error(f"Weather API error: {str(e)}") raise RuntimeError(f"Weather API error: {str(e)}") ``` @@ -448,7 +448,7 @@ Let's build your first MCP server in Python! We'll create a weather server that async with httpx.AsyncClient() as client: response = await client.get(..., params={..., **http_params}) response.raise_for_status() - except requests.HTTPError as e: + except httpx.HTTPError as e: raise McpError( ErrorCode.INTERNAL_ERROR, f"API error: {str(e)}"