summaryrefslogtreecommitdiff
path: root/ext/node/ops/require.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-07-17 14:00:44 -0400
committerGitHub <noreply@github.com>2023-07-17 14:00:44 -0400
commit7a9f7f34195d74fe60eb48381bc2a32db741ceb7 (patch)
treec10516eda55afebb75f98bbfecd1cc555891e3ce /ext/node/ops/require.rs
parent37241e9b1e2d16cd160d529e69c6a782fff8a8b4 (diff)
fix(node): improve require esm error messages (#19853)
Part of #19842. Closes #19583 Closes #16913
Diffstat (limited to 'ext/node/ops/require.rs')
-rw-r--r--ext/node/ops/require.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs
index 87b75c88c..f758ec973 100644
--- a/ext/node/ops/require.rs
+++ b/ext/node/ops/require.rs
@@ -371,7 +371,8 @@ where
&Url::from_file_path(parent_path.unwrap()).unwrap(),
permissions,
)
- .ok();
+ .ok()
+ .flatten();
if pkg.is_none() {
return Ok(None);
}
@@ -499,7 +500,7 @@ where
fn op_require_read_closest_package_json<P>(
state: &mut OpState,
filename: String,
-) -> Result<PackageJson, AnyError>
+) -> Result<Option<PackageJson>, AnyError>
where
P: NodePermissions + 'static,
{