The errors.py module#
Summary#
Base class for typed errors raised by leaves and backends. |
|
Raised when a backend call fails because the backend is unavailable. |
|
Raised when a backend call fails because the backend is not connected. |
|
Raised when a backend call fails due to invalid arguments. |
|
Raised when a backend call fails due to an upstream error (for example, a network issue). |
|
Raised when a backend discovery operation fails. |
Wrap an async tool handler so unexpected exceptions become TypedError. |
Description#
Helper module to handle errors.
Typed error helpers and a guard decorator that converts 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.fluent.mcp.common.models.TypedError]]#
Wrap an async tool handler so unexpected exceptions become TypedError.
FluidsMCPErrorsubclasses are converted to their typed form. Anything else is logged and wrapped as internal_error.
- errors.T#
- errors.logger#