Do not call description() when displaying the error

This commit is contained in:
Matthias Beyer 2017-12-25 19:44:29 +01:00
parent 986dbad2fd
commit 0ae7b6b387

View file

@ -90,7 +90,7 @@ fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> {
} else { } else {
write!(stderr(), "\n").ok(); write!(stderr(), "\n").ok();
} }
write!(stderr(), "{}: {}", Red.paint(format!("ERROR[{:>4}]", idx)), e.description()).ok(); write!(stderr(), "{}: {}", Red.paint(format!("ERROR[{:>4}]", idx)), e).ok();
e.cause() e.cause()
} }
@ -100,7 +100,7 @@ fn count_error_causes(e: &Error) -> u64 {
} }
fn print_trace_dbg(idx: u64, e: &Error) { fn print_trace_dbg(idx: u64, e: &Error) {
debug!("{}: {}", Red.blink().paint(format!("ERROR[{:>4}]", idx)), e.description()); debug!("{}: {}", Red.blink().paint(format!("ERROR[{:>4}]", idx)), e);
if e.cause().is_some() { if e.cause().is_some() {
e.cause().map(|c| print_trace_dbg(idx + 1, c)); e.cause().map(|c| print_trace_dbg(idx + 1, c));
} }