pub enum LspError {
Show 13 variants
ServerStartup {
message: String,
},
Communication {
message: String,
},
ServerCrash {
server_id: String,
},
ProtocolMismatch {
expected: String,
actual: String,
},
InvalidConfiguration {
message: String,
},
Timeout {
timeout_ms: u64,
},
InvalidUri {
uri: String,
},
ServerNotFound {
server_id: String,
},
FeatureNotSupported {
feature: String,
server_id: String,
},
JsonRpc {
message: String,
},
Io(Error),
Serialization(Error),
Custom {
message: String,
},
}Expand description
Comprehensive error types for LSP Bridge operations.
Variants§
ServerStartup
Server startup or initialization failed
Communication
Server communication error
ServerCrash
Server crashed or became unresponsive
ProtocolMismatch
Protocol version mismatch
InvalidConfiguration
Invalid server configuration
Timeout
Request timeout
InvalidUri
Invalid document URI
ServerNotFound
Server not found
FeatureNotSupported
Feature not supported by server
JsonRpc
JSON-RPC error
Io(Error)
IO error
Serialization(Error)
Serialization error
Custom
Custom error for extensibility
Implementations§
Source§impl LspError
impl LspError
Sourcepub fn server_startup<S: Into<String>>(message: S) -> Self
pub fn server_startup<S: Into<String>>(message: S) -> Self
Create a new server startup error
Sourcepub fn communication<S: Into<String>>(message: S) -> Self
pub fn communication<S: Into<String>>(message: S) -> Self
Create a new communication error
Sourcepub fn server_crash<S: Into<String>>(server_id: S) -> Self
pub fn server_crash<S: Into<String>>(server_id: S) -> Self
Create a new server crash error
Sourcepub fn invalid_configuration<S: Into<String>>(message: S) -> Self
pub fn invalid_configuration<S: Into<String>>(message: S) -> Self
Create a new invalid configuration error
Sourcepub fn invalid_uri<S: Into<String>>(uri: S) -> Self
pub fn invalid_uri<S: Into<String>>(uri: S) -> Self
Create a new invalid URI error
Sourcepub fn server_not_found<S: Into<String>>(server_id: S) -> Self
pub fn server_not_found<S: Into<String>>(server_id: S) -> Self
Create a new server not found error
Sourcepub fn feature_not_supported<S: Into<String>>(feature: S, server_id: S) -> Self
pub fn feature_not_supported<S: Into<String>>(feature: S, server_id: S) -> Self
Create a new feature not supported error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if the error is recoverable
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level
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)>
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()
Auto Trait Implementations§
impl Freeze for LspError
impl !RefUnwindSafe for LspError
impl Send for LspError
impl Sync for LspError
impl Unpin for LspError
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more