Skip to content

Commit

Permalink
feat(error): Display for Error shows better info
Browse files Browse the repository at this point in the history
Displays the inner error for Error types with inner errors instead of
just displaying the description.

Closes #694
  • Loading branch information
DarinM223 authored and seanmonstar committed Jun 20, 2016
1 parent cb119a1 commit 5620fbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}
}

Expand Down

0 comments on commit 5620fbf

Please sign in to comment.