pub enum LspError {
Transport(TransportError),
Codec(CodecError),
Framing(FrameError),
Server(ResponseError),
ActorGone,
ResponseDropped,
Cancelled,
HandshakeFailed(String),
ResponseDecode(Error),
NotInitialized,
}Expand description
All failure modes a ServerHandle caller can observe.
Variants§
Transport(TransportError)
Failed to spawn the server binary or capture its stdio. Usually the binary isn’t on PATH or isn’t executable.
Codec(CodecError)
Codec-level failure – bad framing, mid-message EOF, invalid JSON-RPC body. These tear the transport down; the supervisor may restart.
Framing(FrameError)
Frame-header level failure. Distinct from Codec so the
supervisor can decide framing errors are unrecoverable
(server is sending garbage) while body errors might be a
version mismatch (server speaks an older spec).
Server(ResponseError)
The server returned a JSON-RPC error response. Carries
the structured ResponseError so callers can branch on
error_codes::REQUEST_CANCELLED etc.
ActorGone
Outbound request failed because the actor’s mailbox is closed (the actor task has shut down).
ResponseDropped
The actor task accepted the request but the response
oneshot::Sender was dropped without sending. Means the
actor task panicked or shut down between accepting the
request and dispatching the response.
Cancelled
The request was cancelled (either by the client via
$/cancelRequest, by content-modification supersession,
or by an explicit shutdown).
HandshakeFailed(String)
Server failed the initialize handshake. Distinct from
Server so the actor knows the server is unusable and
not to send further requests.
ResponseDecode(Error)
Server response could not be deserialized into the
requested type. The caller asked for T, the server sent
JSON that doesn’t match T’s shape. Indicates either a
spec mismatch or a buggy server.
NotInitialized
Server expected the client to be initialized but got a request before initialize completed. Should be unreachable from outside the actor, but the path is here in case a misbehaving call sneaks past gating.
Implementations§
Trait Implementations§
Source§impl Error for LspError
impl Error for LspError
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
use the Display impl or to_string()
Source§impl From<CodecError> for LspError
impl From<CodecError> for LspError
Source§fn from(source: CodecError) -> Self
fn from(source: CodecError) -> Self
Source§impl From<FrameError> for LspError
impl From<FrameError> for LspError
Source§fn from(source: FrameError) -> Self
fn from(source: FrameError) -> Self
Source§impl From<TransportError> for LspError
impl From<TransportError> for LspError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for LspError
impl !UnwindSafe for LspError
impl Freeze for LspError
impl Send for LspError
impl Sync for LspError
impl Unpin for LspError
impl UnsafeUnpin for LspError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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