From 7a9f7f34195d74fe60eb48381bc2a32db741ceb7 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 17 Jul 2023 14:00:44 -0400 Subject: fix(node): improve require esm error messages (#19853) Part of #19842. Closes #19583 Closes #16913 --- ext/node/ops/require.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/node/ops') 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

( state: &mut OpState, filename: String, -) -> Result +) -> Result, AnyError> where P: NodePermissions + 'static, { -- cgit v1.2.3