The errors.py module#
Summary#
Base class for typed errors raised by leaves and backends. |
|
Error raised when the requested backend cannot be used. |
|
Error raised when an operation requires an active connection. |
|
Error raised when a tool receives invalid arguments. |
|
Error raised when an upstream CFX or provider call fails. |
|
Error raised when API or model discovery fails. |
Wrap an MCP tool so domain errors are returned as typed payloads. |
Description#
Typed error helpers and typed-guard helpers.
Convert unexpected exceptions into a TypedError instead of crashing the MCP transport.
Module detail#
- errors.typed_guard(func: Callable[Ellipsis, Awaitable[T]]) Callable[Ellipsis, Awaitable[T | ansys.cfx.mcp.common.models.TypedError]]#
Wrap an MCP tool so domain errors are returned as typed payloads.
- errors.T#
- errors.logger#
- errors.NotConnected#
- errors.InvalidArguments#