pub enum HandlerError {
Internal {
message: String,
},
Unsupported {
detail: String,
},
Custom {
code: i32,
message: String,
data: Option<Value>,
},
}Expand description
Errors a LexHandler method can surface.
A handler that hits an internal failure returns Err(HandlerError::...);
the host folds the error into a synthetic diagnostic at the labelled
node’s range and continues processing other labels. Subprocess transports
map these variants onto JSON-RPC error responses with the standard
reserved code ranges (-32000..=-32099 for handler-defined; -32601 for
unsupported method/format).
Variants§
Internal
Handler hit an internal error (panic, library failure, unexpected
state). Maps to JSON-RPC -32603.
Unsupported
Handler does not support the requested operation — for example,
on_render was called with a format the handler does not produce.
Maps to JSON-RPC -32601.
Custom
Handler-defined error. code should fall in the
-32000..=-32099 range reserved for handler use. Maps to
JSON-RPC error with the supplied code, message, and optional data.
Implementations§
Trait Implementations§
Source§impl Clone for HandlerError
impl Clone for HandlerError
Source§fn clone(&self) -> HandlerError
fn clone(&self) -> HandlerError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandlerError
impl Debug for HandlerError
Source§impl Display for HandlerError
impl Display for HandlerError
Source§impl Error for HandlerError
impl Error for HandlerError
1.30.0 · 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 PartialEq for HandlerError
impl PartialEq for HandlerError
Source§fn eq(&self, other: &HandlerError) -> bool
fn eq(&self, other: &HandlerError) -> bool
self and other values to be equal, and is used by ==.