pub enum CoreError {
Protocol(ProtocolError),
Io(Error),
NothingToUndo,
NothingToRedo,
NoPath,
Cancelled,
}Expand description
Every error lattice-core returns.
Callers mostly propagate it with ? via CoreResult. The variants
worth matching on are CoreError::NothingToUndo /
CoreError::NothingToRedo (a user-facing no-op, not a failure) and
CoreError::Cancelled (a cooperative abort, not a failure either).
Variants§
Protocol(ProtocolError)
A position or range was invalid for the buffer it was applied to
(out of bounds, or end < start). Raised by
Buffer::slice,
Buffer::apply_edit and everything built
on them.
Io(Error)
A filesystem read or write failed — Document::open
(including a file that is not valid UTF-8) or a save.
NothingToUndo
Document::undo with an empty undo stack.
NothingToRedo
Document::redo with an empty redo stack.
NoPath
Document::save on a document with no path.
Cancelled
A long-running operation was interrupted by a flipped
[lattice_protocol::CancellationToken]. Bubbles up from
the search hot loops so callers (grammar dispatcher,
substitute) can map it to their domain-specific error.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()