summaryrefslogtreecommitdiff
path: root/src/module_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r--src/module_wrap.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index b735fd8e3b..48af2daa13 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -685,8 +685,7 @@ void ModuleWrap::Resolve(const FunctionCallbackInfo<Value>& args) {
Maybe<URL> result = node::loader::Resolve(env, specifier_std, url);
if (result.IsNothing() || (result.FromJust().flags() & URL_FLAGS_FAILED)) {
std::string msg = "Cannot find module " + specifier_std;
- env->ThrowError(msg.c_str());
- return;
+ return node::THROW_ERR_MISSING_MODULE(env, msg.c_str());
}
args.GetReturnValue().Set(result.FromJust().ToObject(env));