pub enum McpErrorKind {
InvalidParams,
Retryable {
code: i32,
data: Value,
},
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);Variants§
InvalidParams
Caller-fault: the request itself was invalid. Maps to JSON-RPC
-32602 (INVALID_PARAMS).
Retryable
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.
Fields
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.