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) -> MCPError
pub fn method_not_found(msg: String) -> MCPError
pub fn not_found(msg: String) -> MCPError
pub fn invalid_request(msg: String) -> MCPError
pub fn invalid_response(msg: String) -> MCPError
pub fn serialization_error(msg: String) -> MCPError
pub fn transport_error(msg: String) -> MCPError
pub fn request_timeout() -> MCPError
pub fn internal_error(msg: String) -> MCPError
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) -> MCPError
fn from(source: AuthenticationError) -> MCPError
Converts to this type from the input type.
Source§impl From<JsonRpcError> for MCPError
impl From<JsonRpcError> for MCPError
Source§fn from(err: JsonRpcError) -> MCPError
fn from(err: JsonRpcError) -> MCPError
Converts to this type from the input type.
Source§impl From<ProtocolError> for MCPError
impl From<ProtocolError> for MCPError
Source§fn from(source: ProtocolError) -> MCPError
fn from(source: ProtocolError) -> MCPError
Converts to this type from the input type.
Source§impl From<RateLimitError> for MCPError
impl From<RateLimitError> for MCPError
Source§fn from(source: RateLimitError) -> MCPError
fn from(source: RateLimitError) -> MCPError
Converts to this type from the input type.
Source§impl From<ResourceError> for MCPError
impl From<ResourceError> for MCPError
Source§fn from(source: ResourceError) -> MCPError
fn from(source: ResourceError) -> MCPError
Converts to this type from the input type.
Source§impl From<TransportError> for MCPError
impl From<TransportError> for MCPError
Source§fn from(source: TransportError) -> MCPError
fn from(source: TransportError) -> MCPError
Converts to this type from the input type.
Source§impl From<ValidationError> for MCPError
impl From<ValidationError> for MCPError
Source§fn from(source: ValidationError) -> MCPError
fn from(source: ValidationError) -> MCPError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.