Merge pull request #46 from modelcontextprotocol/davidsp/fix-docs
docs: fix requests.HTTPError -> httpx.HTTPError
This commit is contained in:
commit
f02570cb6a
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
text=json.dumps(forecasts, indent=2)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
except requests.HTTPError as e:
|
except httpx.HTTPError as e:
|
||||||
logger.error(f"Weather API error: {str(e)}")
|
logger.error(f"Weather API error: {str(e)}")
|
||||||
raise RuntimeError(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:
|
async with httpx.AsyncClient() as client:
|
||||||
response = await client.get(..., params={..., **http_params})
|
response = await client.get(..., params={..., **http_params})
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except requests.HTTPError as e:
|
except httpx.HTTPError as e:
|
||||||
raise McpError(
|
raise McpError(
|
||||||
ErrorCode.INTERNAL_ERROR,
|
ErrorCode.INTERNAL_ERROR,
|
||||||
f"API error: {str(e)}"
|
f"API error: {str(e)}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue