error: Use better error messages.

This commit is contained in:
Emmanuel Gil Peyrot 2019-09-07 16:15:32 +02:00
commit 79804e2b01

View file

@ -48,14 +48,14 @@ pub enum Error {
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match *self { match self {
Error::ParseError(s) => write!(fmt, "{}", s), Error::ParseError(s) => write!(fmt, "parse error: {}", s),
Error::Base64Error(ref e) => write!(fmt, "{}", e), Error::Base64Error(e) => write!(fmt, "base64 error: {}", e),
Error::ParseIntError(ref e) => write!(fmt, "{}", e), Error::ParseIntError(e) => write!(fmt, "integer parsing error: {}", e),
Error::ParseStringError(ref e) => write!(fmt, "{}", e), Error::ParseStringError(e) => write!(fmt, "string parsing error: {}", e),
Error::ParseAddrError(ref e) => write!(fmt, "{}", e), Error::ParseAddrError(e) => write!(fmt, "IP address parsing error: {}", e),
Error::JidParseError(_) => write!(fmt, "JID parse error"), Error::JidParseError(e) => write!(fmt, "JID parsing error: {}", e),
Error::ChronoParseError(ref e) => write!(fmt, "{}", e), Error::ChronoParseError(e) => write!(fmt, "time parsing error: {}", e),
} }
} }
} }