Module nvim_rs::error [−][src]
Expand description
Errors of nvim-rs.
Nvim-rs reports very detailed errors, to facilitate debugging by logging
even in rare edge cases, and to enable clients to handle errors according to
their needs. Errors are boxed to not overly burden the size of the
Result
s.
Overview
Errors can originate in three ways:
- Failure of a request to neovim is communicated by a
CallError
. - A failure in the io loop is communicated by a
LoopError
. - A failure to connect to neovim when starting up via one of the
new_*
functions is communicated by anio::Error
.
Most errors should probably be treated as fatal, and the application should just exit.
Special errors
Use is_reader_error
to check if it might sense to try to show an error message to the neovim
user (see this example).
Use
CallError::is_channel_closed
or
LoopError::is_channel_closed
to determine if the error originates from a closed channel. This means
either neovim closed the channel actively, or neovim was closed. Often, this
is not seen as a real error, but the signal for the plugin to quit. Again,
see the example.
Enums
A call
to neovim failed
Receiving a message from neovim failed
Sending a message to neovim failed
A message from neovim had an invalid format
A failure in the io loop