pub enum ProtocolError {
Show 14 variants
CapabilityNotSupported(String),
InvalidCapabilityNegotiation,
UnexpectedMessageType,
InvalidMessageSequence,
ResourceNotFound(String),
ToolNotFound(String),
PromptNotFound(String),
PermissionDenied,
RateLimitExceeded,
UnsupportedProtocolVersion(String),
InitializationFailed(String),
InvalidSessionState(String),
MissingParameter(String),
InvalidParameterValue(String),
}
Expand description
Protocol-specific errors.
These errors occur at the MCP protocol layer and relate to protocol violations, capability mismatches, or invalid message sequences.
§Examples
use mocopr_core::error::ProtocolError;
let error = ProtocolError::ToolNotFound("nonexistent_tool".to_string());
Variants§
CapabilityNotSupported(String)
A required capability is not supported by the remote endpoint.
InvalidCapabilityNegotiation
The capability negotiation process failed or was invalid.
UnexpectedMessageType
Received an unexpected message type for the current protocol state.
InvalidMessageSequence
The message sequence violates the protocol specification.
ResourceNotFound(String)
The requested resource was not found on the server.
ToolNotFound(String)
The requested tool was not found on the server.
PromptNotFound(String)
The requested prompt was not found on the server.
PermissionDenied
Access to the requested resource or operation was denied.
RateLimitExceeded
The rate limit for requests has been exceeded.
UnsupportedProtocolVersion(String)
The protocol version is not supported.
InitializationFailed(String)
The initialization handshake failed.
InvalidSessionState(String)
The session is in an invalid state for the requested operation.
MissingParameter(String)
A required parameter is missing from the request.
InvalidParameterValue(String)
A parameter value is out of the valid range or format.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ProtocolError> for Error
impl From<ProtocolError> for Error
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
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> 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.