Skip to content

Commit f3c3a30

Browse files
committed
Print backtraces for errors
1 parent 5842d3e commit f3c3a30

File tree

1 file changed

+3
-2
lines changed
  • collector/src/bin/rustc-perf-collector

1 file changed

+3
-2
lines changed

collector/src/bin/rustc-perf-collector/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ fn get_benchmarks(
331331
exclude: Option<&str>,
332332
) -> anyhow::Result<Vec<Benchmark>> {
333333
let mut benchmarks = Vec::new();
334-
'outer: for entry in fs::read_dir(benchmark_dir).context("failed to list benchmarks")? {
334+
'outer: for entry in fs::read_dir(benchmark_dir)
335+
.with_context(|| format!("failed to list benchmark dir {}", benchmark_dir.display()))? {
335336
let entry = entry?;
336337
let path = entry.path();
337338
let name = match entry.file_name().into_string() {
@@ -383,7 +384,7 @@ fn main() {
383384
match main_result() {
384385
Ok(code) => process::exit(code),
385386
Err(err) => {
386-
eprintln!("{}", err);
387+
eprintln!("{:#}\n{}", err, err.backtrace());
387388
process::exit(1);
388389
}
389390
}

0 commit comments

Comments
 (0)