Skip to content

Commit 0f52688

Browse files
committed
refactor: error gracefully
1 parent 162996e commit 0f52688

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crates/exec-harness/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ pub fn read_commands_from_stdin() -> Result<Vec<BenchmarkCommand>> {
7272
if !stdin_path.is_absolute() {
7373
cmd.stdin = Some(
7474
std::fs::canonicalize(stdin_path)
75-
.unwrap_or_else(|_| std::env::current_dir().unwrap().join(stdin_path)),
75+
.or_else(|_| std::env::current_dir().map(|d| d.join(stdin_path)))
76+
.with_context(|| {
77+
format!("Failed to resolve stdin path: {}", stdin_path.display())
78+
})?,
7679
);
7780
}
7881
}

0 commit comments

Comments
 (0)