pub enum FormsError {
UnsupportedYear(i32),
MapFieldMissing(String),
Overflow {
part: &'static str,
rows: usize,
capacity: usize,
},
Geometry(String),
UnmappedField(String),
CellOverflow {
fqn: String,
max_len: usize,
len: usize,
},
Structure(String),
Pdf(Error),
Map(Error),
Io(Error),
}Expand description
Anything that can go wrong filling an official IRS PDF.
The geometric read-back failures (Geometry, UnmappedField) are the tax-safety net: a fill
that lands a value in the wrong cell — or writes any field the map did not authorize — FAILS
CLOSED (no PDF bytes are returned), so a mis-mapped form is never handed to a filer.
Variants§
UnsupportedYear(i32)
The requested tax year has no bundled form set / map (this build ships TY2017, 2024 + 2025).
MapFieldMissing(String)
A field named by the map does not exist in the bundled PDF’s AcroForm.
Overflow
More data rows than the form’s page grid can hold on the paths that do not paginate.
Fields
Geometry(String)
The geometric read-back found a written value in the WRONG column/row band — the map is mis-aligned. Fails closed.
UnmappedField(String)
A field carries a value but the map never authorized writing it (a stray write). Fails closed.
CellOverflow
A written value is longer than the cell’s /MaxLen — the form declares a fixed-width (usually
comb) cell and the value does not fit. A PDF viewer would silently truncate it, or splay it
across the wrong comb teeth, so the fill fails closed instead: a truncated SSN on a filed return
is a wrong return.
Fields
Structure(String)
The bundled PDF’s structure was not what the engine expects (missing AcroForm, bad Rect, …).
Pdf(Error)
Underlying lopdf parse/serialize error.
Map(Error)
A committed TOML map failed to parse.
Io(Error)
I/O error serializing the PDF.
Trait Implementations§
Source§impl Debug for FormsError
impl Debug for FormsError
Source§impl Display for FormsError
impl Display for FormsError
Source§impl Error for FormsError
impl Error for FormsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()