File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1348,6 +1348,11 @@ The `REPL` module was unable parse data from the REPL history file.
1348
1348
1349
1349
An attempt was made to ` require() ` an [ ES6 module] [ ] .
1350
1350
1351
+ <a id =" ERR_SCRIPT_EXECUTION_INTERRUPTED " ></a >
1352
+ ### ERR_SCRIPT_EXECUTION_INTERRUPTED
1353
+
1354
+ Script execution was interrupted by ` SIGINT ` (For example, when Ctrl+C was pressed).
1355
+
1351
1356
<a id =" ERR_SERVER_ALREADY_LISTEN " ></a >
1352
1357
### ERR_SERVER_ALREADY_LISTEN
1353
1358
Original file line number Diff line number Diff line change @@ -445,6 +445,8 @@ E('ERR_OUTOFMEMORY', 'Out of memory');
445
445
E ( 'ERR_OUT_OF_RANGE' , 'The "%s" argument is out of range' ) ;
446
446
E ( 'ERR_PARSE_HISTORY_DATA' , 'Could not parse history data in %s' ) ;
447
447
E ( 'ERR_REQUIRE_ESM' , 'Must use import to load ES Module: %s' ) ;
448
+ E ( 'ERR_SCRIPT_EXECUTION_INTERRUPTED' ,
449
+ 'Script execution was interrupted by `SIGINT`.' ) ;
448
450
E ( 'ERR_SERVER_ALREADY_LISTEN' ,
449
451
'Listen method has been called more than once without closing.' ) ;
450
452
E ( 'ERR_SOCKET_ALREADY_BOUND' , 'Socket is already bound' ) ;
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ function REPLServer(prompt,
319
319
} catch ( e ) {
320
320
err = e ;
321
321
322
- if ( err && err . message === 'Script execution interrupted. ' ) {
322
+ if ( err && err . code === 'ERR_SCRIPT_EXECUTION_INTERRUPTED ' ) {
323
323
// The stack trace for this case is not very useful anyway.
324
324
Object . defineProperty ( err , 'stack' , { value : '' } ) ;
325
325
}
@@ -339,7 +339,7 @@ function REPLServer(prompt,
339
339
if ( self . breakEvalOnSigint ) {
340
340
const interrupt = new Promise ( ( resolve , reject ) => {
341
341
sigintListener = ( ) => {
342
- reject ( new Error ( 'Script execution interrupted. ' ) ) ;
342
+ reject ( new errors . Error ( 'ERR_SCRIPT_EXECUTION_INTERRUPTED ' ) ) ;
343
343
} ;
344
344
prioritizedSigintQueue . add ( sigintListener ) ;
345
345
} ) ;
@@ -358,7 +358,7 @@ function REPLServer(prompt,
358
358
// Remove prioritized SIGINT listener if it was not called.
359
359
prioritizedSigintQueue . delete ( sigintListener ) ;
360
360
361
- if ( err . message === 'Script execution interrupted. ' ) {
361
+ if ( err . code === 'ERR_SCRIPT_EXECUTION_INTERRUPTED ' ) {
362
362
// The stack trace for this case is not very useful anyway.
363
363
Object . defineProperty ( err , 'stack' , { value : '' } ) ;
364
364
}
Original file line number Diff line number Diff line change @@ -160,7 +160,8 @@ async function ctrlCTest() {
160
160
{ ctrl : true , name : 'c' }
161
161
] ) , [
162
162
'await timeout(100000)\r' ,
163
- 'Thrown: Error: Script execution interrupted.' ,
163
+ 'Thrown: Error [ERR_SCRIPT_EXECUTION_INTERRUPTED]: ' +
164
+ 'Script execution was interrupted by `SIGINT`.' ,
164
165
PROMPT
165
166
] ) ;
166
167
}
You can’t perform that action at this time.
0 commit comments