use crate::ebook::errors::{ArchiveError, FormatError};
use thiserror::Error;
pub type ReaderResult<T> = Result<T, ReaderError>;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum ReaderError {
#[error("[OutOfBounds Error]: The position `{position}` must be less than the length `{len}`")]
OutOfBounds {
position: usize,
len: usize,
},
#[error("[NoMapping Error]: The provided `{0}` has no corresponding mapping")]
NoMapping(
String,
),
#[error(transparent)]
Archive(#[from] ArchiveError),
#[error(transparent)]
Format(#[from] FormatError),
}