pub struct ErrorCode(pub i32);
Expand description
A JSON-RPC error code.
Codes defined and/or used by LSP are defined as associated constants, eg.
ErrorCode::REQUEST_FAILED
.
Tuple Fields§
§0: i32
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const PARSE_ERROR: Self
pub const PARSE_ERROR: Self
Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
Defined by JSON-RPC.
Sourcepub const INVALID_REQUEST: Self
pub const INVALID_REQUEST: Self
The JSON sent is not a valid Request object.
Defined by JSON-RPC.
Sourcepub const METHOD_NOT_FOUND: Self
pub const METHOD_NOT_FOUND: Self
The method does not exist / is not available.
Defined by JSON-RPC.
Sourcepub const INVALID_PARAMS: Self
pub const INVALID_PARAMS: Self
Invalid method parameter(s).
Defined by JSON-RPC.
Sourcepub const INTERNAL_ERROR: Self
pub const INTERNAL_ERROR: Self
Internal JSON-RPC error.
Defined by JSON-RPC.
Sourcepub const JSONRPC_RESERVED_ERROR_RANGE_START: Self
pub const JSONRPC_RESERVED_ERROR_RANGE_START: Self
This is the start range of JSON-RPC reserved error codes.
It doesn’t denote a real error code. No LSP error codes should
be defined between the start and end range. For backwards
compatibility the ServerNotInitialized
and the UnknownErrorCode
are left in the range.
@since 3.16.0
Sourcepub const SERVER_NOT_INITIALIZED: Self
pub const SERVER_NOT_INITIALIZED: Self
Error code indicating that a server received a notification or
request before the server has received the initialize
request.
Sourcepub const UNKNOWN_ERROR_CODE: Self
pub const UNKNOWN_ERROR_CODE: Self
(Defined by LSP specification without description)
Sourcepub const JSONRPC_RESERVED_ERROR_RANGE_END: Self
pub const JSONRPC_RESERVED_ERROR_RANGE_END: Self
This is the end range of JSON-RPC reserved error codes. It doesn’t denote a real error code.
@since 3.16.0
Sourcepub const LSP_RESERVED_ERROR_RANGE_START: Self
pub const LSP_RESERVED_ERROR_RANGE_START: Self
This is the start range of LSP reserved error codes. It doesn’t denote a real error code.
@since 3.16.0
Sourcepub const REQUEST_FAILED: Self
pub const REQUEST_FAILED: Self
A request failed but it was syntactically correct, e.g the method name was known and the parameters were valid. The error message should contain human readable information about why the request failed.
@since 3.17.0
Sourcepub const SERVER_CANCELLED: Self
pub const SERVER_CANCELLED: Self
The server cancelled the request. This error code should only be used for requests that explicitly support being server cancellable.
@since 3.17.0
Sourcepub const CONTENT_MODIFIED: Self
pub const CONTENT_MODIFIED: Self
The server detected that the content of a document got modified outside normal conditions. A server should NOT send this error code if it detects a content change in it unprocessed messages. The result even computed on an older state might still be useful for the client.
If a client decides that a result is not of any use anymore the client should cancel the request.
Sourcepub const REQUEST_CANCELLED: Self
pub const REQUEST_CANCELLED: Self
The client has canceled a request and a server as detected the cancel.
Sourcepub const LSP_RESERVED_ERROR_RANGE_END: Self
pub const LSP_RESERVED_ERROR_RANGE_END: Self
This is the end range of LSP reserved error codes. It doesn’t denote a real error code.
@since 3.16.0