GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: honor --abort_on_uncaught_exception flag · nodejs/node@2034f68

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.cc
  • test/abort
    • test-abort-uncaught-exception.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,11 @@ void FatalException(Isolate* isolate,
21922192

21932193
if (false == caught->BooleanValue()) {
21942194
ReportException(env, error, message);
2195-
exit(1);
2195+
if (abort_on_uncaught_exception) {
2196+
ABORT();
2197+
} else {
2198+
exit(1);
2199+
}
21962200
}
21972201
}
21982202

Collapse file

‎test/abort/test-abort-uncaught-exception.js‎

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const spawn = require('child_process').spawn;
6+
const node = process.execPath;
7+
8+
if (process.argv[2] === 'child') {
9+
throw new Error('child error');
10+
} else {
11+
run('', null);
12+
run('--abort-on-uncaught-exception', 'SIGABRT');
13+
}
14+
15+
function run(flags, signal) {
16+
const args = [__filename, 'child'];
17+
if (flags)
18+
args.unshift(flags);
19+
20+
const child = spawn(node, args);
21+
child.on('exit', common.mustCall(function(code, sig) {
22+
if (!common.isWindows) {
23+
assert.strictEqual(sig, signal);
24+
} else {
25+
if (signal)
26+
assert.strictEqual(code, 3);
27+
else
28+
assert.strictEqual(code, 1);
29+
}
30+
}));
31+
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.