2017-03-08 20:34:17 +01:00
|
|
|
//! Provides an error type for this crate.
|
|
|
|
|
|
2017-02-19 20:46:44 +01:00
|
|
|
use std::convert::From;
|
|
|
|
|
|
2017-05-22 19:20:01 +02:00
|
|
|
error_chain! {
|
|
|
|
|
foreign_links {
|
2017-06-07 22:40:53 +02:00
|
|
|
XmlError(::quick_xml::errors::Error)
|
|
|
|
|
/// An error from quick_xml.
|
2017-05-22 19:20:01 +02:00
|
|
|
;
|
2017-06-07 22:40:53 +02:00
|
|
|
Utf8Error(::std::str::Utf8Error)
|
|
|
|
|
/// An UTF-8 conversion error.
|
2017-05-22 19:20:01 +02:00
|
|
|
;
|
2017-06-07 22:40:53 +02:00
|
|
|
IoError(::std::io::Error)
|
2017-05-22 19:20:01 +02:00
|
|
|
/// An I/O error, from std::io.
|
|
|
|
|
;
|
2017-02-19 20:46:44 +01:00
|
|
|
}
|
|
|
|
|
|
2017-05-22 19:20:01 +02:00
|
|
|
errors {
|
2017-06-07 22:40:53 +02:00
|
|
|
/// An error which is returned when the end of the document was reached prematurely.
|
2017-05-22 19:20:01 +02: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 22:40:53 +02: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 23:58:03 +02: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 20:46:44 +01:00
|
|
|
}
|
|
|
|
|
}
|