1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Error management module

#![allow(missing_docs)]

error_chain! {
    foreign_links {
        Io(::std::io::Error);
    }
    errors {
        EndEventMismatch(expected: String, found: String) {
            description("end event name mismatch with last start event name")
            display("expecting </{}> found </{}>", expected, found)
        }
        Attribute(msg: String, i: usize) {
            description("error while parsing attributes")
            display("error while parsing attribute at position {}: {}", i, msg)
        }
        Escape(msg: String, range: ::std::ops::Range<usize>) {
            description("error while escaping bytes")
            display("Error while escaping character at range {:?}: {}", range, msg)
        }
    }
}