mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-27 07:50:43 +02:00
run api ref gen
This commit is contained in:
parent
9bbca08862
commit
034fa72b9c
50 changed files with 685 additions and 469 deletions
40
docs/python-sdk/fastmcp-server-middleware-error_handling.mdx
Normal file
40
docs/python-sdk/fastmcp-server-middleware-error_handling.mdx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
title: error_handling
|
||||
sidebarTitle: error_handling
|
||||
---
|
||||
|
||||
# `fastmcp.server.middleware.error_handling`
|
||||
|
||||
|
||||
Error handling middleware for consistent error responses and tracking.
|
||||
|
||||
## Classes
|
||||
|
||||
### `ErrorHandlingMiddleware` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/middleware/error_handling.py#L15" target="_blank">↗</a></sup>
|
||||
|
||||
|
||||
Middleware that provides consistent error handling and logging.
|
||||
|
||||
Catches exceptions, logs them appropriately, and converts them to
|
||||
proper MCP error responses. Also tracks error patterns for monitoring.
|
||||
|
||||
|
||||
**Methods:**
|
||||
|
||||
#### `get_error_stats` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/middleware/error_handling.py#L121" target="_blank">↗</a></sup>
|
||||
|
||||
```python
|
||||
get_error_stats(self) -> dict[str, int]
|
||||
```
|
||||
|
||||
Get error statistics for monitoring.
|
||||
|
||||
|
||||
### `RetryMiddleware` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/middleware/error_handling.py#L126" target="_blank">↗</a></sup>
|
||||
|
||||
|
||||
Middleware that implements automatic retry logic for failed requests.
|
||||
|
||||
Retries requests that fail with transient errors, using exponential
|
||||
backoff to avoid overwhelming the server or external dependencies.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue