From a6b64ca957858c613be57912d68e763331c6f474 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 2 Jul 2020 16:23:25 -0400 Subject: [PATCH] Print backtraces for errors --- collector/src/bin/rustc-perf-collector/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collector/src/bin/rustc-perf-collector/main.rs b/collector/src/bin/rustc-perf-collector/main.rs index 0fa1b2d6f..0cdad4fcc 100644 --- a/collector/src/bin/rustc-perf-collector/main.rs +++ b/collector/src/bin/rustc-perf-collector/main.rs @@ -331,7 +331,8 @@ fn get_benchmarks( exclude: Option<&str>, ) -> anyhow::Result> { let mut benchmarks = Vec::new(); - 'outer: for entry in fs::read_dir(benchmark_dir).context("failed to list benchmarks")? { + 'outer: for entry in fs::read_dir(benchmark_dir) + .with_context(|| format!("failed to list benchmark dir {}", benchmark_dir.display()))? { let entry = entry?; let path = entry.path(); let name = match entry.file_name().into_string() { @@ -383,7 +384,7 @@ fn main() { match main_result() { Ok(code) => process::exit(code), Err(err) => { - eprintln!("{:#}", err); + eprintln!("{:#}\n{}", err, err.backtrace()); process::exit(1); } }