#[non_exhaustive]pub enum Error {
Show 30 variants
LspInitFailed {
message: String,
},
LspServerError {
code: i32,
message: String,
data: Option<Value>,
},
McpServer(String),
DocumentNotFound(PathBuf),
NoServerForLanguage(String),
ServerInitializing(String),
NoServerConfigured,
Config(String),
ConfigNotFound(PathBuf),
InvalidConfig(String),
Io(Error),
Json(Error),
TomlDe(Error),
TomlSer(Error),
Transport(String),
Timeout(u64),
Shutdown,
ServerSpawnFailed {
command: String,
source: Error,
},
LspProtocolError(String),
InvalidUri(String),
EncodingError(String),
ServerTerminated,
InvalidToolParams(String),
FileIo {
path: PathBuf,
source: Error,
},
PathOutsideWorkspace(PathBuf),
DocumentLimitExceeded {
current: usize,
max: usize,
},
FileSizeLimitExceeded {
size: u64,
max: u64,
},
PartialServerInit {
failed_count: usize,
total_count: usize,
failures: Vec<ServerSpawnFailure>,
},
AllServersFailedToInit {
count: usize,
failures: Vec<ServerSpawnFailure>,
},
NoServersAvailable(String),
}Expand description
The main error type for mcpls-core operations.
This enum is #[non_exhaustive]: downstream crates that match on it must
include a wildcard arm. New variants (such as Error::ServerInitializing)
can then be added without further breaking changes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LspInitFailed
LSP server failed to initialize.
LspServerError
LSP server returned an error response.
Fields
McpServer(String)
MCP server error.
DocumentNotFound(PathBuf)
Document was not found or could not be opened.
NoServerForLanguage(String)
No LSP server configured for the given language.
ServerInitializing(String)
LSP server for the language is configured but still initializing.
NoServerConfigured
No LSP server is currently configured.
Config(String)
Configuration error.
ConfigNotFound(PathBuf)
Configuration file not found.
InvalidConfig(String)
Invalid configuration format.
Io(Error)
I/O error.
Json(Error)
JSON serialization/deserialization error.
TomlDe(Error)
TOML deserialization error.
TomlSer(Error)
TOML serialization error.
Transport(String)
LSP client transport error.
Timeout(u64)
Request timeout.
Shutdown
Server shutdown requested.
ServerSpawnFailed
LSP server failed to spawn.
LspProtocolError(String)
LSP protocol error during message parsing.
InvalidUri(String)
Invalid URI format.
EncodingError(String)
Position encoding error.
ServerTerminated
Server process terminated unexpectedly.
InvalidToolParams(String)
Invalid tool parameters provided.
FileIo
File I/O error occurred.
PathOutsideWorkspace(PathBuf)
Path is outside allowed workspace boundaries.
DocumentLimitExceeded
Document limit exceeded.
FileSizeLimitExceeded
File size limit exceeded.
PartialServerInit
Partial server initialization - some servers failed but at least one succeeded.
Fields
failures: Vec<ServerSpawnFailure>Details of each failure.
AllServersFailedToInit
All configured LSP servers failed to initialize.
Fields
failures: Vec<ServerSpawnFailure>Details of each failure.
NoServersAvailable(String)
No LSP servers available (none configured or all failed).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()