mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
Fix error classification using __cause__ instead of raised exception type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3e1aadb282
commit
59b19eb549
1 changed files with 1 additions and 1 deletions
|
|
@ -89,7 +89,7 @@ class ErrorHandlingMiddleware(Middleware):
|
|||
return error
|
||||
|
||||
# Map common exceptions to appropriate MCP error codes
|
||||
error_type = type(error.__cause__) if error.__cause__ else type(error)
|
||||
error_type = type(error)
|
||||
|
||||
if error_type in (ValueError, TypeError):
|
||||
return McpError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue