image_ndarray/
error.rs

1use thiserror::Error;
2
3/// Global error object for the image-ndarray crate.
4#[derive(Debug, Error, PartialEq)]
5pub enum Error {
6    #[error("NDArray had an error during initializaiton of shape: {0}")]
7    NDArray(#[from] ndarray::ShapeError),
8    #[error("Image could not be constructed from ndarray.")]
9    ImageConstructFailed,
10    #[error("Image could not be constructed from ndarray because output does not match input channel count.")]
11    ChannelMismatch
12}
13
14pub type Result<T> = std::result::Result<T, Error>;