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.

Exceptions
AbstractJsonRpcProtocolException

Base for every JSON-RPC protocol-level failure raised by the SDK.

DuplicateInboundRequestIdException

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

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).

LogicException

Developer-facing SDK misuse, surfaced at composition time and never sent to a peer.

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.

OutboundRequestFailedException

Thrown when a transport cannot carry an outbound request to completion.

OutboundRequestsNotSupportedException

Thrown when an inbound-request handler invokes SenderInterface::sendRequest() on a sender that cannot carry server-to-client requests.

RemoteCallFailedException

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

RequestTimeoutException

Thrown when an outbound request's deadline elapses before the peer answers it.

ResponseTooLargeException

Thrown when a peer's response exceeds the byte cap the reader is willing to hold in memory.

RuntimeException

Runtime failure whose message is the whole diagnostic, with no branch a consumer takes on the type.

SupervisionExhaustedException

Thrown when a supervised transport has spent its restart budget and stops respawning the peer.

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.

UnexpectedHttpStatusException

Thrown when an HTTP exchange answers with a status that carries no JSON-RPC payload settling the message the exchange was sent for.