pub enum SdkErrorCodes {
CONNECTION_CLOSED = -32_000,
REQUEST_TIMEOUT = -32_001,
RESOURCE_NOT_FOUND = -32_002,
BAD_REQUEST = -32_015,
SESSION_NOT_FOUND = -32_016,
MISSING_REQUIRED_CLIENT_CAPABILITY = -32_021,
UNSUPPORTED_PROTOCOL_VERSION = -32_022,
INVALID_REQUEST = -32_600,
METHOD_NOT_FOUND = -32_601,
INVALID_PARAMS = -32_602,
INTERNAL_ERROR = -32_603,
PARSE_ERROR = -32_700,
}Expand description
Enum representing SDK error codes.
Grouping (reconciled with the 2026-07-28 schema):
- SDK-internal (transport/session; not in the MCP spec):
CONNECTION_CLOSED,REQUEST_TIMEOUT,RESOURCE_NOT_FOUND,BAD_REQUEST,SESSION_NOT_FOUND. - MCP-spec (also schema-derived in
RpcErrorCodesand as typed error structsMissingRequiredClientCapabilityError/UnsupportedProtocolVersionError):MISSING_REQUIRED_CLIENT_CAPABILITY,UNSUPPORTED_PROTOCOL_VERSION. - JSON-RPC standard (also schema-derived in
RpcErrorCodesand as typed error structsParseError/InvalidRequestError/etc.):INVALID_REQUEST,METHOD_NOT_FOUND,INVALID_PARAMS,INTERNAL_ERROR,PARSE_ERROR.
Prefer RpcErrorCodes (schema-derived) for protocol errors on the wire; use
SdkErrorCodes for SDK-internal transport/session failures.
Variants§
CONNECTION_CLOSED = -32_000
REQUEST_TIMEOUT = -32_001
RESOURCE_NOT_FOUND = -32_002
BAD_REQUEST = -32_015
SESSION_NOT_FOUND = -32_016
MISSING_REQUIRED_CLIENT_CAPABILITY = -32_021
UNSUPPORTED_PROTOCOL_VERSION = -32_022
INVALID_REQUEST = -32_600
METHOD_NOT_FOUND = -32_601
INVALID_PARAMS = -32_602
INTERNAL_ERROR = -32_603
PARSE_ERROR = -32_700
Trait Implementations§
Source§impl Display for SdkErrorCodes
impl Display for SdkErrorCodes
Source§impl From<SdkErrorCodes> for i64
impl From<SdkErrorCodes> for i64
Source§fn from(code: SdkErrorCodes) -> Self
fn from(code: SdkErrorCodes) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SdkErrorCodes
impl RefUnwindSafe for SdkErrorCodes
impl Send for SdkErrorCodes
impl Sync for SdkErrorCodes
impl Unpin for SdkErrorCodes
impl UnsafeUnpin for SdkErrorCodes
impl UnwindSafe for SdkErrorCodes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more