1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

chore: Improving FS Error Message for op_realpath_sync and op_realpath_async (#18404)

#17526
This commit is contained in:
Mike Mulchrone 2023-03-26 05:20:51 -04:00 committed by GitHub
parent 0742ea1170
commit 3c5350f949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1456,7 +1456,9 @@ where
debug!("op_realpath_sync {}", path.display());
// corresponds to the realpath on Unix and
// CreateFile and GetFinalPathNameByHandle on Windows
let realpath = canonicalize_path(&path)?;
let realpath = canonicalize_path(&path).map_err(|error| {
default_err_mapper(error, format!("op_realpath_sync '{}'", path.display()))
})?;
let realpath_str = into_string(realpath.into_os_string())?;
Ok(realpath_str)
}
@ -1488,7 +1490,12 @@ where
debug!("op_realpath_async {}", path.display());
// corresponds to the realpath on Unix and
// CreateFile and GetFinalPathNameByHandle on Windows
let realpath = canonicalize_path(&path)?;
let realpath = canonicalize_path(&path).map_err(|error| {
default_err_mapper(
error,
format!("op_realpath_async '{}'", path.display()),
)
})?;
let realpath_str = into_string(realpath.into_os_string())?;
Ok(realpath_str)
})