use xmlparser::{
self,
ErrorPos,
};
#[derive(Fail, Debug)]
pub enum StreamError {
#[fail(display = "invalid color at {}", _0)]
InvalidColor(ErrorPos),
#[fail(display = "invalid number at {}", _0)]
InvalidNumber(ErrorPos),
#[fail(display = "invalid length at {}", _0)]
InvalidLength(ErrorPos),
#[fail(display = "invalid entity reference at {}", _0)]
InvalidEntityRef(ErrorPos),
#[fail(display = "invalid transform prefix at {}", _0)]
InvalidTransformPrefix(ErrorPos),
#[fail(display = "'{}' is an invalid align type", _0)]
InvalidAlignType(String),
#[fail(display = "expected 'meet' or 'slice' not '{}'", _0)]
InvalidAlignSlice(String),
#[fail(display = "current attribute doesn't support the '{}' value", _0)]
InvalidPredefValue(String),
#[fail(display = "expected a FuncIRI not '{}'", _0)]
NotAFuncIRI(String),
#[fail(display = "viewBox should have a positive size")]
InvalidViewbox,
#[fail(display = "{}", _0)]
XmlError(xmlparser::StreamError),
}
impl From<xmlparser::StreamError> for StreamError {
fn from(v: xmlparser::StreamError) -> Self {
StreamError::XmlError(v)
}
}
pub type StreamResult<T> = ::std::result::Result<T, StreamError>;