error.rs

 1//! Provides an error type for this crate.
 2
 3use std::io;
 4
 5use std::convert::From;
 6
 7use xml::writer::Error as WriterError;
 8use xml::reader::Error as ReaderError;
 9
10error_chain! {
11    foreign_links {
12        XmlWriterError(WriterError)
13            /// An error with writing an XML event, from xml::writer::EventWriter.
14        ;
15        XmlReaderError(ReaderError)
16            /// An error with reading an XML event, from xml::reader::EventReader.
17        ;
18        IoError(io::Error)
19            /// An I/O error, from std::io.
20        ;
21    }
22
23    errors {
24        /// En error which is returned when the end of the document was reached prematurely.
25        EndOfDocument {
26            description("the end of the document has been reached prematurely")
27            display("the end of the document has been reached prematurely")
28        }
29    }
30}