1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum AchError {
8 #[error("Invalid record type: {0}")]
10 InvalidRecordType(String),
11
12 #[error("Invalid line length: expected 94, got {0}")]
14 InvalidLineLength(usize),
15
16 #[error("Invalid numeric field '{field}': {source}")]
18 InvalidNumber {
19 field: &'static str,
20 source: std::num::ParseIntError,
21 },
22
23 #[error("Invalid file structure: {0}")]
25 InvalidStructure(String),
26
27 #[error("Empty file")]
29 EmptyFile,
30
31 #[error("Incomplete batch: {0}")]
33 IncompleteBatch(String),
34}