use svgparser;
use simplecss;
use {
ErrorPos,
};
error_chain! {
types {
Error, ErrorKind, ResultExt, Result;
}
links {
Xml(svgparser::Error, svgparser::ErrorKind) #[doc = "svgparser errors"];
}
errors {
ElementMustHaveAnId {
display("the element must have an id")
}
ElementCrosslink {
display("element crosslink")
}
NoSvgElement {
display("the document does not have an SVG element")
}
EmptyDocument {
display("the document does not have any nodes")
}
UnsupportedCSS(pos: ErrorPos) {
display("unsupported CSS at {}", pos)
}
InvalidCSS(pos: ErrorPos) {
display("invalid CSS at {}", pos)
}
UnsupportedEntity(pos: ErrorPos) {
display("unsupported ENTITY data at {}", pos)
}
UnsupportedPaintFallback(iri: String) {
display("valid FuncIRI(#{}) with fallback value is not supported", iri)
}
BrokenFuncIri(iri: String) {
display("the 'use' element with a broken filter attribute('#{}') is not supported", iri)
}
InvalidEncoding {
display("the input data is not a valid UTF-8 string")
}
MissingAttribute(name: String, value: String) {
display("attribute '{}' is missing in the '{}' element", name, value)
}
CssError(e: simplecss::Error) {
display("{:?}", e)
}
}
}
impl From<simplecss::Error> for Error {
fn from(value: simplecss::Error) -> Error {
ErrorKind::CssError(value).into()
}
}