pub enum Error {
Show 24 variants
LspInitFailed {
message: String,
},
LspServerError {
code: i32,
message: String,
},
McpServer(String),
DocumentNotFound(PathBuf),
NoServerForLanguage(String),
Config(String),
ConfigNotFound(PathBuf),
InvalidConfig(String),
Io(Error),
Json(Error),
Toml(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,
},
}Expand description
The main error type for mcpls-core operations.
Variants§
LspInitFailed
LSP server failed to initialize.
LspServerError
LSP server returned an error response.
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.
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.
Toml(Error)
TOML parsing 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.
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)>
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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