#[non_exhaustive]pub enum McpErrorKind {
InvalidParams,
InvalidPosition(RewrittenServerError),
SymbolResolution(SymbolResolutionData),
Retryable(RetryableErrorData),
Internal,
}Expand description
JSON-RPC error-code classification for an Error, returned by
Error::mcp_error_kind.
mcpls-core has no dependency on the MCP transport crate, so this carries
only plain data; crate::mcp is responsible for turning it into the
actual wire-level error type.
§Examples
use mcpls_core::error::{Error, McpErrorKind};
let err = Error::InvalidToolParams("missing `file_path`".to_string());
assert_eq!(err.mcp_error_kind(), McpErrorKind::InvalidParams);This enum is #[non_exhaustive]: match it with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidParams
Caller-fault: the request itself was invalid. Maps to JSON-RPC
-32602 (INVALID_PARAMS).
InvalidPosition(RewrittenServerError)
Caller-fault: the position fell outside the document and the server’s
raw error was rewritten for display. Maps to -32602 with the
original error as data.
SymbolResolution(SymbolResolutionData)
Caller-fault: a symbol name did not resolve to exactly one position.
Maps to -32602 with the structured resolution outcome as data.
Retryable(RetryableErrorData)
A transient, retryable server-side condition, distinct from a crash.
Maps to a bespoke JSON-RPC code with a structured data payload a
caller can act on mechanically, rather than the generic
INTERNAL_ERROR.
Internal
An unexpected server-side failure. Maps to JSON-RPC -32603
(INTERNAL_ERROR).
Trait Implementations§
Source§impl Clone for McpErrorKind
impl Clone for McpErrorKind
Source§impl Debug for McpErrorKind
impl Debug for McpErrorKind
impl Eq for McpErrorKind
Source§impl PartialEq for McpErrorKind
impl PartialEq for McpErrorKind
impl StructuralPartialEq for McpErrorKind
Auto Trait Implementations§
impl Freeze for McpErrorKind
impl RefUnwindSafe for McpErrorKind
impl Send for McpErrorKind
impl Sync for McpErrorKind
impl Unpin for McpErrorKind
impl UnsafeUnpin for McpErrorKind
impl UnwindSafe for McpErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.