image_ndarray/
error.rs

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