use pdfboss_core::ObjRef;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("i/o error: {0}")]
Io(#[from] std::io::Error),
#[error("object {} {} already has a body", .0.num, .0.gen)]
AlreadyFilled(ObjRef),
#[error("object {} {} was reserved but never filled", .0.num, .0.gen)]
Unfilled(ObjRef),
#[error("stream objects must be indirect, not nested")]
NestedStream,
#[error("character {ch:?} is not encodable in {font}")]
Unencodable {
ch: char,
font: &'static str,
},
#[error("invalid image: {0}")]
Image(String),
#[error("{0}")]
Other(String),
}