Skip to main content

fastpack_compress/
error.rs

1use thiserror::Error;
2
3/// Errors produced by image encoding and compression operations.
4#[derive(Debug, Error)]
5pub enum CompressError {
6    #[error("image encoding failed: {0}")]
7    ImageEncode(#[from] image::ImageError),
8    #[cfg(feature = "png")]
9    #[error("png optimization failed: {0}")]
10    /// PNG optimization via oxipng failed.
11    PngOptimize(#[from] oxipng::PngError),
12    #[error("{0}")]
13    /// An error not covered by the other variants.
14    Other(String),
15}