summaryrefslogtreecommitdiff
path: root/src/module_wrap.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-04-19 18:41:33 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-04-25 23:46:08 +0800
commit3152b7c0d329893d2fe9f74ff4f334d182a10545 (patch)
treea79c4d4e578bf30020f19c6a71311ab748d34b52 /src/module_wrap.cc
parent94e0e2c787deade5702026b6d6eea8dcfee3b6a3 (diff)
downloadnode-new-3152b7c0d329893d2fe9f74ff4f334d182a10545.tar.gz
src: assign ERR_SCRIPT_EXECUTION_* codes in C++
Also modifies the error messages so they include more information and are more consistent. - The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions SIGINT and the trailing period is dropped for consistency. - Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout in the message. PR-URL: https://github.com/nodejs/node/pull/20147 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r--src/module_wrap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 9bcdb4dce7..f88c113ae0 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -286,9 +286,9 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
// which this timeout is nested, so check whether one of the watchdogs
// from this invocation is responsible for termination.
if (timed_out) {
- env->ThrowError("Script execution timed out.");
+ THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(env, timeout);
} else if (received_signal) {
- env->ThrowError("Script execution interrupted.");
+ THROW_ERR_SCRIPT_EXECUTION_INTERRUPTED(env);
}
}