#[cfg(not(feature = "std"))]
use alloc::borrow::Cow;
#[derive(Debug, thiserror::Error)]
pub enum DjVuError {
#[error("IFF error: {0}")]
Iff(#[from] IffError),
#[error("JB2 error: {0}")]
Jb2(#[from] Jb2Error),
#[error("IW44 error: {0}")]
Iw44(#[from] Iw44Error),
#[error("BZZ error: {0}")]
Bzz(#[from] BzzError),
#[error("page {0} not found")]
PageNotFound(usize),
#[error("invalid structure: {0}")]
InvalidStructure(&'static str),
#[error("unsupported: {0}")]
#[cfg(feature = "std")]
Unsupported(std::borrow::Cow<'static, str>),
#[error("unsupported: {0}")]
#[cfg(not(feature = "std"))]
Unsupported(Cow<'static, str>),
#[cfg(feature = "std")]
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
}
pub use djvu_iff::IffError;
pub use djvu_jb2::Jb2Error;
pub use djvu_iw44::Iw44Error;
pub use djvu_bzz::BzzError;
pub use djvu_iff::LegacyError;
pub use LegacyError as Error;