diff options
Diffstat (limited to 'ext/node/package_json.rs')
-rw-r--r-- | ext/node/package_json.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/node/package_json.rs b/ext/node/package_json.rs index 8a88fe8f1..b28207db8 100644 --- a/ext/node/package_json.rs +++ b/ext/node/package_json.rs @@ -1,7 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use deno_config::package_json::PackageJson; -use deno_config::package_json::PackageJsonLoadError; use deno_config::package_json::PackageJsonRc; use deno_fs::DenoConfigFsAdapter; use std::cell::RefCell; @@ -10,6 +9,8 @@ use std::io::ErrorKind; use std::path::Path; use std::path::PathBuf; +use crate::errors::PackageJsonLoadError; + // use a thread local cache so that workers have their own distinct cache thread_local! { static CACHE: RefCell<HashMap<PathBuf, PackageJsonRc>> = RefCell::new(HashMap::new()); @@ -48,11 +49,9 @@ pub fn load_pkg_json( ); match result { Ok(pkg_json) => Ok(Some(pkg_json)), - Err(PackageJsonLoadError::Io { source, .. }) - if source.kind() == ErrorKind::NotFound => - { - Ok(None) - } - Err(err) => Err(err), + Err(deno_config::package_json::PackageJsonLoadError::Io { + source, .. + }) if source.kind() == ErrorKind::NotFound => Ok(None), + Err(err) => Err(PackageJsonLoadError(err)), } } |