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§
- Call
Error - A
call
to neovim failed - Decode
Error - Receiving a message from neovim failed
- Encode
Error - Sending a message to neovim failed
- Handshake
Error - Invalid
Message - A message from neovim had an invalid format
- Loop
Error - A failure in the io loop