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 29 30 31
use std::io; use rustc_serialize::json::DecoderError; use rustc_serialize::json::ParserError; quick_error! { #[derive(Debug)] pub enum Error { DuplicateKeys { description("Duplicate keys") } ExpectedJsonObject { description("Expected JSON object") } IOError(err: io::Error) { from() description("IO error") cause(err) } DecodeError(err: DecoderError) { from() description("Decoder error") cause(err) } ParserError(err: ParserError) { from() description("Parser error") cause(err) } } }