pub enum MCPError {
Protocol(ProtocolError),
Transport(TransportError),
ToolExecution(ToolError),
Resource(ResourceError),
Authentication(AuthenticationError),
Validation(ValidationError),
RateLimit(RateLimitError),
Serialization(Error),
Io(Error),
Other(Error),
}Expand description
Main error type for MCP operations
Variants§
Protocol(ProtocolError)
Transport(TransportError)
ToolExecution(ToolError)
Resource(ResourceError)
Authentication(AuthenticationError)
Validation(ValidationError)
RateLimit(RateLimitError)
Serialization(Error)
Io(Error)
Other(Error)
Implementations§
Source§impl MCPError
impl MCPError
pub fn invalid_params(msg: String) -> Self
pub fn method_not_found(msg: String) -> Self
pub fn not_found(msg: String) -> Self
pub fn invalid_request(msg: String) -> Self
pub fn invalid_response(msg: String) -> Self
pub fn serialization_error(msg: String) -> Self
pub fn transport_error(msg: String) -> Self
pub fn request_timeout() -> Self
pub fn internal_error(msg: String) -> Self
Trait Implementations§
Source§impl Error for MCPError
impl Error for MCPError
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<AuthenticationError> for MCPError
impl From<AuthenticationError> for MCPError
Source§fn from(source: AuthenticationError) -> Self
fn from(source: AuthenticationError) -> Self
Converts to this type from the input type.
Source§impl From<JsonRpcError> for MCPError
impl From<JsonRpcError> for MCPError
Source§fn from(err: JsonRpcError) -> Self
fn from(err: JsonRpcError) -> Self
Converts to this type from the input type.
Source§impl From<ProtocolError> for MCPError
impl From<ProtocolError> for MCPError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<RateLimitError> for MCPError
impl From<RateLimitError> for MCPError
Source§fn from(source: RateLimitError) -> Self
fn from(source: RateLimitError) -> Self
Converts to this type from the input type.
Source§impl From<ResourceError> for MCPError
impl From<ResourceError> for MCPError
Source§fn from(source: ResourceError) -> Self
fn from(source: ResourceError) -> Self
Converts to this type from the input type.
Source§impl From<TransportError> for MCPError
impl From<TransportError> for MCPError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl From<ValidationError> for MCPError
impl From<ValidationError> for MCPError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MCPError
impl !RefUnwindSafe for MCPError
impl Send for MCPError
impl Sync for MCPError
impl Unpin for MCPError
impl !UnwindSafe for MCPError
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