Skip to content

Commit bf56e69

Browse files
committed
docs: fix requests.HTTPError -> httpx.HTTPError
This fixes modelcontextprotocol#44.
1 parent 4cee64b commit bf56e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/first-server/python.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Let's build your first MCP server in Python! We'll create a weather server that
247247
text=json.dumps(forecasts, indent=2)
248248
)
249249
]
250-
except requests.HTTPError as e:
250+
except httpx.HTTPError as e:
251251
logger.error(f"Weather API error: {str(e)}")
252252
raise RuntimeError(f"Weather API error: {str(e)}")
253253
```
@@ -448,7 +448,7 @@ Let's build your first MCP server in Python! We'll create a weather server that
448448
async with httpx.AsyncClient() as client:
449449
response = await client.get(..., params={..., **http_params})
450450
response.raise_for_status()
451-
except requests.HTTPError as e:
451+
except httpx.HTTPError as e:
452452
raise McpError(
453453
ErrorCode.INTERNAL_ERROR,
454454
f"API error: {str(e)}"

0 commit comments

Comments
 (0)