crabtalk_memory/error.rs
1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[error("entry not found: {0}")]
8 NotFound(String),
9 #[error("entry already exists: {0}")]
10 Duplicate(String),
11 #[error("bad memory file format: {0}")]
12 BadFormat(&'static str),
13 #[error("invalid entry name for dump: {0:?}")]
14 InvalidName(String),
15 #[error(transparent)]
16 Io(#[from] std::io::Error),
17}