-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display impl for Error eats all the useful information #694
Comments
Fair point. A nice fix here would be to use the description for hyper errors, but delegate to Example: impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Io(ref e) | Uri(ref e) | Ssl(ref e) | Http2(ref e) | Utf8(ref e) => fmt::Display::fmt(e, f),
e => f.write_str(e.description())
}
}
} |
Yeah, I'd be happy with that. |
I tend to go with something like impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(f.write_str(self.description())
match *self {
AllThingsWithInnerErrors(ref e) => write!(f, ": {}", e),
....
}
}
} |
With rust-lang/rust#30312 being merged, at least this should state something more than |
I'm getting conflicting messages from this thread. If the problem is that |
@xaviershay the problem is that a |
@xaviershay it's because the |
Hey all, I am a little confused on this issue. @seanmonstar, did your PR rust-lang/rust#30312 resolve the matter or am I not quite understanding? Apologies, I'm still getting used to Rust and would like to help if I can. |
@josephpd3 I'm sure that PR improved things. We could make it a little better in hyper by doing as I suggest in the 2nd comment. |
Displays the inner error for Error types with inner errors instead of just displaying the description. Closes hyperium#694
Displays the inner error for Error types with inner errors instead of just displaying the description. Closes #694
The Display impl for Error passes through to
std::error::Error::description()
, which is pretty-much useless. For example, all I/O errors become simply "os error" through this lens.The text was updated successfully, but these errors were encountered: