From 5620fbf98f1fd43482a9ffa3c98f2f38b42fd4b0 Mon Sep 17 00:00:00 2001 From: Darin Minamoto Date: Sat, 18 Jun 2016 12:27:13 -0700 Subject: [PATCH] feat(error): Display for Error shows better info Displays the inner error for Error types with inner errors instead of just displaying the description. Closes #694 --- src/error.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index ab164c2b82..8f1f2d6a47 100644 --- a/src/error.rs +++ b/src/error.rs @@ -68,7 +68,13 @@ impl fmt::Debug for Void { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str(self.description()) + match *self { + Uri(ref e) => fmt::Display::fmt(e, f), + Io(ref e) => fmt::Display::fmt(e, f), + Ssl(ref e) => fmt::Display::fmt(e, f), + Utf8(ref e) => fmt::Display::fmt(e, f), + ref e => f.write_str(e.description()), + } } }