Skip to content

Commit 841d2ec

Browse files
committed
Print path in error message when canonicalization fails
1 parent 976289a commit 841d2ec

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/args.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,18 @@ where
249249
A: Iterator<Item = String>,
250250
{
251251
let mut arg_iter = args.into_iter().fuse();
252-
let test_path = PathBuf::from(
252+
let test_path_arg = PathBuf::from(
253253
arg_iter
254254
.next()
255255
.ok_or("excepted path to test source file as first argument")?,
256-
)
257-
.canonicalize()
258-
.map_err(|err| format!("Failed to canonicalize test path: {}", err))?;
256+
);
257+
let test_path = test_path_arg.canonicalize().map_err(|err| {
258+
format!(
259+
"Failed to canonicalize test path `{}`: {}",
260+
test_path_arg.display(),
261+
err
262+
)
263+
})?;
259264
let mut run_command = None;
260265
let mut target = None;
261266

0 commit comments

Comments
 (0)