pub enum Error {
Show 14 variants
InternalError(String),
TransportError(String),
ProtocolError(String),
ParseError(String),
AuthError(String),
ConfigError(String),
ServerError(i32, String, Option<Value>),
Timeout(String),
UnsupportedFeature(String),
NotInitialized,
ConnectionClosed(String),
JsonError(String),
IoError(String),
UrlError(String),
}
Expand description
Errors that can occur in the MCP SDK
Variants§
InternalError(String)
Internal error
TransportError(String)
Transport error
ProtocolError(String)
Protocol error
ParseError(String)
Parse error
AuthError(String)
Authentication error
ConfigError(String)
Configuration error
ServerError(i32, String, Option<Value>)
Server error
Timeout(String)
Request timeout
UnsupportedFeature(String)
The requested feature is not supported
NotInitialized
The client or server is not initialized
ConnectionClosed(String)
The connection was closed
JsonError(String)
JSON serialization/deserialization error
IoError(String)
IO error
UrlError(String)
Invalid URL
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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