Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5fe27c

Browse filesBrowse files
joyeecheungrvagg
authored andcommitted
process: delay setup of global exception handlers
Since bootstrap/node.js performs the setup synchronously, the process exception handlers do not have to setup so early in the bootstrap process - any fatal errors thrown before user code execution should simply crash the process, and we do not care about any clean up at that point. We don't care about emitting any events if the process crash upon bootstrap either. PR-URL: #26061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent 0c4353a commit b5fe27c
Copy full SHA for b5fe27c

File tree

Expand file treeCollapse file tree

1 file changed

+14
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-18
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+14-18Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,6 @@ setupTraceCategoryState();
4646

4747
setupProcessObject();
4848

49-
// TODO(joyeecheung): this does not have to done so early, any fatal errors
50-
// thrown before user code execution should simply crash the process
51-
// and we do not care about any clean up at that point. We don't care
52-
// about emitting any events if the process crash upon bootstrap either.
53-
{
54-
const {
55-
fatalException,
56-
setUncaughtExceptionCaptureCallback,
57-
hasUncaughtExceptionCaptureCallback
58-
} = NativeModule.require('internal/process/execution');
59-
60-
process._fatalException = fatalException;
61-
process.setUncaughtExceptionCaptureCallback =
62-
setUncaughtExceptionCaptureCallback;
63-
process.hasUncaughtExceptionCaptureCallback =
64-
hasUncaughtExceptionCaptureCallback;
65-
}
66-
6749
setupGlobalProxy();
6850
setupBuffer();
6951

@@ -303,6 +285,20 @@ Object.defineProperty(process, 'features', {
303285
}
304286
});
305287

288+
{
289+
const {
290+
fatalException,
291+
setUncaughtExceptionCaptureCallback,
292+
hasUncaughtExceptionCaptureCallback
293+
} = NativeModule.require('internal/process/execution');
294+
295+
process._fatalException = fatalException;
296+
process.setUncaughtExceptionCaptureCallback =
297+
setUncaughtExceptionCaptureCallback;
298+
process.hasUncaughtExceptionCaptureCallback =
299+
hasUncaughtExceptionCaptureCallback;
300+
}
301+
306302
// User-facing NODE_V8_COVERAGE environment variable that writes
307303
// ScriptCoverage to a specified file.
308304
if (process.env.NODE_V8_COVERAGE) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.