1use thiserror::Error;
2
3#[derive(Debug, Error)]
5#[non_exhaustive]
6pub enum Error {
7 #[error("input does not look like XML")]
8 NotXml,
9 #[error("XML root is not a namespaced GAEB document")]
10 NotGaeb,
11 #[error("invalid XML: {0}")]
12 Xml(String),
13 #[error("I/O error: {0}")]
14 Io(#[from] std::io::Error),
15 #[error("{0:?} is not an XML Schema decimal lexical value")]
16 InvalidDecimal(String),
17 #[error("GAEB item {0:?} was not found")]
18 ItemNotFound(String),
19 #[error("GAEB item ID {0:?} occurs more than once")]
20 AmbiguousItem(String),
21 #[error("GAEB item {0:?} has no Qty value")]
22 QuantityMissing(String),
23 #[error(
24 "GAEB item {0:?} has a Qty value that cannot be edited without changing non-value XML"
25 )]
26 QuantityNotEditable(String),
27}