#[derive(Debug, Clone, PartialEq)]
pub enum XsdParseError {
UnexpectedEndOfSchema {
remaining_frames: usize,
},
ParseError {
position: usize,
message: String,
},
}
impl std::fmt::Display for XsdParseError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
XsdParseError::UnexpectedEndOfSchema { remaining_frames } => {
write!(
f,
"unexpected end of schema, stack not empty: {} frames remaining",
remaining_frames
)
}
XsdParseError::ParseError { position, message } => {
write!(f, "parse error at position {}: {}", position, message)
}
}
}
}
impl std::error::Error for XsdParseError {}