diff options
Diffstat (limited to 'runtime/fs_util.rs')
-rw-r--r-- | runtime/fs_util.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/fs_util.rs b/runtime/fs_util.rs index bf0735205..93286ecf3 100644 --- a/runtime/fs_util.rs +++ b/runtime/fs_util.rs @@ -1,6 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. use deno_core::error::AnyError; +use deno_core::error::Context; pub use deno_core::normalize_path; use std::env::current_dir; use std::io::Error; @@ -24,7 +25,8 @@ pub fn resolve_from_cwd(path: &Path) -> Result<PathBuf, AnyError> { let resolved_path = if path.is_absolute() { path.to_owned() } else { - let cwd = current_dir().unwrap(); + let cwd = + current_dir().context("Failed to get current working directory")?; cwd.join(path) }; |