use thiserror::Error;
pub type Result<T> = std::result::Result<T, ParseError>;
#[derive(Error, Debug)]
pub enum ParseError {
#[error("XML deserialization error: {message}")]
XmlError {
message: String,
location: Option<String>,
},
#[error("Invalid date format: {0}")]
InvalidDate(String),
#[error("Invalid decimal format: {0}")]
InvalidDecimal(String),
#[error("Missing required field: {field} in {context}")]
MissingField {
field: String,
context: String,
},
#[error("Unknown enum variant: {variant} for type {enum_type}")]
UnknownEnumVariant {
variant: String,
enum_type: String,
},
#[error("Unsupported FLEX schema version: {0}")]
UnsupportedSchemaVersion(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
}