#[derive(Debug, thiserror::Error)]
pub enum FormsError {
#[error("unsupported tax year {0}: this build bundles IRS forms for 2017, 2024 and 2025 only")]
UnsupportedYear(i32),
#[error("map references field {0:?} which is absent from the bundled PDF field set")]
MapFieldMissing(String),
#[error("{rows} rows exceed the {capacity}-row capacity of a single {part} page")]
Overflow {
part: &'static str,
rows: usize,
capacity: usize,
},
#[error("geometric read-back FAILED (mis-mapped cell): {0}")]
Geometry(String),
#[error("read-back FAILED: unmapped field {0:?} was filled")]
UnmappedField(String),
#[error("bundled PDF structure error: {0}")]
Structure(String),
#[error("pdf error: {0}")]
Pdf(#[from] lopdf::Error),
#[error("map parse error: {0}")]
Map(#[from] toml::de::Error),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}