2017-03-08 19:34:17 +00:00
|
|
|
//! Provides an error type for this crate.
|
|
|
|
|
2017-02-19 19:46:44 +00:00
|
|
|
use std::convert::From;
|
|
|
|
|
2017-05-22 17:20:01 +00:00
|
|
|
error_chain! {
|
|
|
|
foreign_links {
|
2017-06-07 20:40:53 +00:00
|
|
|
XmlError(::quick_xml::errors::Error)
|
|
|
|
/// An error from quick_xml.
|
2017-05-22 17:20:01 +00:00
|
|
|
;
|
2017-06-07 20:40:53 +00:00
|
|
|
Utf8Error(::std::str::Utf8Error)
|
|
|
|
/// An UTF-8 conversion error.
|
2017-05-22 17:20:01 +00:00
|
|
|
;
|
2017-06-07 20:40:53 +00:00
|
|
|
IoError(::std::io::Error)
|
2017-05-22 17:20:01 +00:00
|
|
|
/// An I/O error, from std::io.
|
|
|
|
;
|
2017-02-19 19:46:44 +00:00
|
|
|
}
|
|
|
|
|
2017-05-22 17:20:01 +00:00
|
|
|
errors {
|
2017-06-07 20:40:53 +00:00
|
|
|
/// An error which is returned when the end of the document was reached prematurely.
|
2017-05-22 17:20:01 +00:00
|
|
|
EndOfDocument {
|
|
|
|
description("the end of the document has been reached prematurely")
|
|
|
|
display("the end of the document has been reached prematurely")
|
|
|
|
}
|
2017-06-07 20:40:53 +00:00
|
|
|
/// An error which is returned when an element is closed when it shouldn't be
|
|
|
|
InvalidElementClosed {
|
|
|
|
description("The XML is invalid, an element was wrongly closed")
|
|
|
|
display("the XML is invalid, an element was wrongly closed")
|
|
|
|
}
|
2017-07-28 21:58:03 +00:00
|
|
|
/// An error which is returned when an elemet's name contains more than one colon
|
|
|
|
InvalidElement {
|
|
|
|
description("The XML element is invalid")
|
|
|
|
display("the XML element is invalid")
|
|
|
|
}
|
2017-02-19 19:46:44 +00:00
|
|
|
}
|
|
|
|
}
|