Skip to main content

hide_something/
error.rs

1//! Error handling for the hide-something crate.
2
3use thiserror::Error;
4
5/// Possible errors that can occur during hiding or extraction.
6#[derive(Error, Debug)]
7pub enum HideSomethingError {
8    /// The carrier template contains no alphabetic characters.
9    #[error("carrier template contains no alphabetic characters")]
10    CarrierTemplateEmpty,
11
12    /// The extracted data is too short to contain the length prefix.
13    #[error("extracted data is too short")]
14    TooShortData,
15
16    /// An I/O or compression error occurred.
17    #[error("I/O or compression error: {0}")]
18    IoError(#[from] std::io::Error),
19
20    /// The decompressed data is not valid UTF‑8.
21    #[error("decoded bytes are not valid UTF‑8: {0}")]
22    Utf8Error(#[from] std::string::FromUtf8Error),
23}