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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
use std::str::Utf8Error; use std::string::FromUtf8Error; use quick_error::quick_error; use super::AddressError; quick_error! { #[derive(Debug)] pub enum ParseError { Io(err: std::io::Error) { from() description(err.description()) cause(err) } Utf8(err: Utf8Error) { from() description(err.description()) cause(err) } FromUtf8(err: FromUtf8Error) { from() description(err.description()) cause(err) } Chrono(err: chrono::ParseError) { from() description(err.description()) cause(err) } WrongType(descr: String) { description(descr) display("Wrong Type {}", descr) } InvalidAddress(err: AddressError) { from() description(err.description()) cause(err) } InvalidPacket(descr: String) { description(descr) display("Invalid Packet {}", descr) } Other(err: Box<dyn std::error::Error>) { cause(&**err) description(err.description()) display("Error {}", err.description()) } } }