Namespace Nexus\Mcp\Core\Exception

Interfaces
JsonRpcProtocolExceptionInterface

Contract for SDK exceptions that translate to a JSON-RPC error response sent to a peer.

McpExceptionInterface

Marker for every exception thrown by this SDK. Consumers can catch this interface to handle any SDK-originated error with a single catch block.

Exceptions
AbstractJsonRpcProtocolException

Base for every JSON-RPC protocol-level failure raised by the SDK. Concrete subclasses pin a JSON-RPC error category and may carry category-specific context.

DuplicateInboundRequestIdException

Thrown when an inbound request reuses an id whose handler coroutine is still running on the same session.

DuplicateOutboundRequestIdException

Thrown when an outbound request reuses an id whose response is still pending.

InvalidParamsException

Thrown when the params payload of a known method fails the shape check the concrete request or notification class enforces in fromArray().

InvalidRequestException

Thrown when the JSON-RPC envelope is structurally valid JSON but does not conform to the JSON-RPC shape (wrong version, missing fields, malformed response).

MethodMisroutedException

Thrown when an inbound envelope's shape (request or notification) does not match the shape the method was registered under.

MethodNotFoundException

Thrown when no class or handler is registered for an inbound method.

OutboundRequestsNotSupportedException

Thrown when an inbound-request handler invokes the SenderInterface::sendRequest() stub before the corresponding outbound-request machinery has been implemented for the dispatching side.

RemoteCallFailedException

Thrown by the outbound-request await chain when the peer answers with a JsonRpcErrorResponse.

TransportAlreadyClosedException

Thrown when a transport operation is invoked on a closed transport.

TransportAlreadyStartedException

Thrown when start() is called on a transport that is already running.

TransportNotStartedException

Thrown when a transport operation is invoked before start() has been called.