pub enum CopilotError {
Show 19 variants
Transport(Error),
ConnectionClosed,
NotConnected,
JsonRpc {
code: i32,
message: String,
data: Option<Value>,
},
ProtocolMismatch {
expected: u32,
actual: u32,
},
Protocol(String),
Json(Error),
Timeout(Duration),
SessionNotFound(String),
SessionDestroyed,
InvalidConfig(String),
ProcessStart(Error),
ProcessExit(Option<i32>),
PortDetectionFailed,
Shutdown,
ToolNotFound(String),
ToolError(String),
PermissionDenied(String),
ChannelError,
}Expand description
Main error type for the Copilot SDK.
Variants§
Transport(Error)
Transport/IO error
ConnectionClosed
Connection was closed unexpectedly
NotConnected
Client is not connected
JsonRpc
JSON-RPC error from server
ProtocolMismatch
Protocol version mismatch
Protocol(String)
Protocol error (framing, invalid messages, etc.)
Json(Error)
JSON serialization/deserialization error
Timeout(Duration)
Request timed out
SessionNotFound(String)
Session not found
SessionDestroyed
Session was already destroyed
InvalidConfig(String)
Invalid configuration
ProcessStart(Error)
Failed to start CLI process
ProcessExit(Option<i32>)
CLI process exited unexpectedly
PortDetectionFailed
Port detection failed in TCP mode
Shutdown
Client is shutting down
ToolNotFound(String)
Tool not found
ToolError(String)
Tool execution error
PermissionDenied(String)
Permission denied
ChannelError
Channel send error (internal)
Implementations§
Trait Implementations§
Source§impl Debug for CopilotError
impl Debug for CopilotError
Source§impl Display for CopilotError
impl Display for CopilotError
Source§impl Error for CopilotError
impl Error for CopilotError
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<Error> for CopilotError
impl From<Error> for CopilotError
Source§impl From<Error> for CopilotError
impl From<Error> for CopilotError
Auto Trait Implementations§
impl Freeze for CopilotError
impl !RefUnwindSafe for CopilotError
impl Send for CopilotError
impl Sync for CopilotError
impl Unpin for CopilotError
impl UnsafeUnpin for CopilotError
impl !UnwindSafe for CopilotError
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more