Print errors to stderr instead of stdout

This commit is contained in:
Alex Crichton 2018-04-30 13:24:29 -07:00
parent 7cef4a66b8
commit 6f95e5c531
2 changed files with 4 additions and 4 deletions

View File

@ -63,9 +63,9 @@ fn main() {
Ok(()) => return, Ok(()) => return,
Err(e) => e, Err(e) => e,
}; };
println!("error: {}", err); eprintln!("error: {}", err);
for cause in err.causes().skip(1) { for cause in err.causes().skip(1) {
println!("\tcaused by: {}", cause); eprintln!("\tcaused by: {}", cause);
} }
process::exit(1); process::exit(1);
} }

View File

@ -50,9 +50,9 @@ fn main() {
Ok(()) => return, Ok(()) => return,
Err(e) => e, Err(e) => e,
}; };
println!("error: {}", err); eprintln!("error: {}", err);
for cause in err.causes().skip(1) { for cause in err.causes().skip(1) {
println!("\tcaused by: {}", cause); eprintln!("\tcaused by: {}", cause);
} }
process::exit(1); process::exit(1);
} }