summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-sigint-existing-handler.js
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 /test/parallel/test-vm-sigint-existing-handler.js
parent94e0e2c787deade5702026b6d6eea8dcfee3b6a3 (diff)
downloadandroid-node-v8-3152b7c0d329893d2fe9f74ff4f334d182a10545.tar.gz
android-node-v8-3152b7c0d329893d2fe9f74ff4f334d182a10545.tar.bz2
android-node-v8-3152b7c0d329893d2fe9f74ff4f334d182a10545.zip
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 'test/parallel/test-vm-sigint-existing-handler.js')
-rw-r--r--test/parallel/test-vm-sigint-existing-handler.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/parallel/test-vm-sigint-existing-handler.js b/test/parallel/test-vm-sigint-existing-handler.js
index 79a4d556ac..13fccd9637 100644
--- a/test/parallel/test-vm-sigint-existing-handler.js
+++ b/test/parallel/test-vm-sigint-existing-handler.js
@@ -36,8 +36,12 @@ if (process.argv[2] === 'child') {
[];
const options = { breakOnSigint: true };
- assert.throws(() => { vm[method](script, ...args, options); },
- /^Error: Script execution interrupted\.$/);
+ common.expectsError(
+ () => { vm[method](script, ...args, options); },
+ {
+ code: 'ERR_SCRIPT_EXECUTION_INTERRUPTED',
+ message: 'Script execution was interrupted by `SIGINT`'
+ });
assert.strictEqual(firstHandlerCalled, 0);
assert.strictEqual(onceHandlerCalled, 0);