From c89998668564cbdd06d776a2b00c47e45004f167 Mon Sep 17 00:00:00 2001 From: rhn Date: Wed, 1 Nov 2017 18:15:34 +0100 Subject: [PATCH] Make Bad Response error print the actual response --- src/error.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/error.rs b/src/error.rs index cc029a4..7b71edf 100644 --- a/src/error.rs +++ b/src/error.rs @@ -62,6 +62,9 @@ impl fmt::Display for Error { Error::Io(ref e) => fmt::Display::fmt(e, f), Error::Tls(ref e) => fmt::Display::fmt(e, f), Error::TlsHandshake(ref e) => fmt::Display::fmt(e, f), + Error::BadResponse(ref data) => { + write!(f, "{}: {}", &String::from(self.description()), &data.join("\n")) + } ref e => f.write_str(e.description()), } }