Error Handling¶
pcp_mcp.errors
¶
Error mapping from httpx to MCP ToolErrors.
PCPError
¶
Bases: Exception
Base PCP error.
handle_pcp_error
¶
Convert PCP/httpx exceptions to MCP ToolErrors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
e
|
Exception
|
The exception to convert. |
required |
operation
|
str
|
Description of the operation that failed. |
required |
Returns:
| Type | Description |
|---|---|
ToolError
|
A ToolError with an appropriate message. |