erased_cells/error.rs
1//! Crate-wide `Result`/`Error` types.
2
3use crate::CellType;
4use thiserror::Error as ThisError;
5
6pub type Result<T, E = Error> = std::result::Result<T, E>;
7
8/// Enumeration of error kinds
9#[derive(ThisError, Debug, PartialEq)]
10pub enum Error {
11 #[error("Invalid narrowing from cell type {src} to {dst}")]
12 NarrowingError { src: CellType, dst: CellType },
13 #[error("Expected a value but received `None`: {0}")]
14 ExpectedError(String),
15 #[error("Unable to parse {0} as a {1}")]
16 ParseError(String, &'static str),
17}