Merge pull request #270 from matthiasbeyer/libimagutil/trace-newline
Add another missing newline character
This commit is contained in:
commit
4a1fd4230e
1 changed files with 7 additions and 3 deletions
|
@ -21,7 +21,7 @@ use std::io::stderr;
|
||||||
/// ```
|
/// ```
|
||||||
pub fn trace_error(e: &Error) {
|
pub fn trace_error(e: &Error) {
|
||||||
print_trace_maxdepth(count_error_causes(e), e, ::std::u64::MAX);
|
print_trace_maxdepth(count_error_causes(e), e, ::std::u64::MAX);
|
||||||
write!(stderr(), "");
|
write!(stderr(), "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Print an Error type and its cause recursively, but only `max` levels
|
/// Print an Error type and its cause recursively, but only `max` levels
|
||||||
|
@ -47,8 +47,12 @@ pub fn trace_error_dbg(e: &Error) {
|
||||||
/// processed.
|
/// processed.
|
||||||
fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> {
|
fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> {
|
||||||
if e.cause().is_some() && idx > 0 {
|
if e.cause().is_some() && idx > 0 {
|
||||||
print_trace_maxdepth(idx - 1, e.cause().unwrap(), max);
|
match print_trace_maxdepth(idx - 1, e.cause().unwrap(), max) {
|
||||||
write!(stderr(), " -- caused:\n");
|
None => write!(stderr(), "\n"),
|
||||||
|
Some(_) => write!(stderr(), " -- caused:\n"),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
write!(stderr(), "\n");
|
||||||
}
|
}
|
||||||
write!(stderr(), "Error {:>4} : {}", idx, e.description());
|
write!(stderr(), "Error {:>4} : {}", idx, e.description());
|
||||||
e.cause()
|
e.cause()
|
||||||
|
|
Loading…
Reference in a new issue