aboutsummaryrefslogtreecommitdiff
path: root/src/errors.rs
blob: 2704bd9451f3f01b48d5748ccbd44cf2b82c2477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use quick_xml;

error_chain! {
    foreign_links {
        Io(::std::io::Error);
        XML(quick_xml::errors::Error);
        NumParse(::std::num::ParseIntError);
        Utf8(::std::str::Utf8Error);
    }
    errors {
        FromXml(pos: usize, tag: String) {
            description("invalid input while processing tag")
            display("error at pos {}: invalid <{}>", pos, tag)
        }
        ElementText(pos: usize) {
            description("found something other than text")
            display("error at pos {}: not text", pos)
        }
        ClosingTag(pos: usize) {
            description("found something other than a closing tag")
            display("error at pos {}: expected a closing tag", pos)
        }
        EOF {
            description("premature EOF")
            display("expected more things")
        }
    }
}