19 lines
504 B
Rust
19 lines
504 B
Rust
use std::io;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum Error {
|
|
// I/O errors
|
|
#[error("Could not open file: {0}")]
|
|
OpenError(io::Error),
|
|
#[error("Could not write file: {0}")]
|
|
WriteError(io::Error),
|
|
#[error("Buffer does not have a path")]
|
|
NoPath,
|
|
#[error("Buffer has unsaved changes: {0}")]
|
|
UnsavedBuffer(&'static str),
|
|
#[error("Invalid command, usage: {0}")]
|
|
InvalidCommand(&'static str),
|
|
#[error("Unknown command: {0:?}")]
|
|
UnknownCommand(String),
|
|
}
|