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 732780f

Browse filesBrowse files
aduh95targos
authored andcommitted
process: refs --unhandled-rejections documentation in warning message
Refs: #20392 PR-URL: #30564 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5537fae commit 732780f
Copy full SHA for 732780f

File tree

Expand file treeCollapse file tree

3 files changed

+11
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/process/promises.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/promises.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ function emitUnhandledRejectionWarning(uid, reason) {
134134
'Unhandled promise rejection. This error originated either by ' +
135135
'throwing inside of an async function without a catch block, ' +
136136
'or by rejecting a promise which was not handled with .catch(). ' +
137+
'To terminate the node process on unhandled promise ' +
138+
'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' +
139+
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ' +
137140
`(rejection id: ${uid})`
138141
);
139142
try {
Collapse file

‎test/parallel/test-promises-unhandled-proxy-rejections.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-promises-unhandled-proxy-rejections.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' +
1212
'This error originated either by throwing ' +
1313
'inside of an async function without a catch ' +
1414
'block, or by rejecting a promise which was ' +
15-
'not handled with .catch(). (rejection id: 1)'];
15+
'not handled with .catch(). To terminate the ' +
16+
'node process on unhandled promise rejection, ' +
17+
'use the CLI flag `--unhandled-rejections=strict` (see ' +
18+
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)'];
1619

1720
function throwErr() {
1821
throw new Error('Error from proxy');
Collapse file

‎test/parallel/test-promises-unhandled-symbol-rejections.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-promises-unhandled-symbol-rejections.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' +
1313
'This error originated either by throwing ' +
1414
'inside of an async function without a catch ' +
1515
'block, or by rejecting a promise which was ' +
16-
'not handled with .catch(). (rejection id: 1)'];
16+
'not handled with .catch(). To terminate the ' +
17+
'node process on unhandled promise rejection, ' +
18+
'use the CLI flag `--unhandled-rejections=strict` (see ' +
19+
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)'];
1720

1821
common.expectWarning({
1922
DeprecationWarning: expectedDeprecationWarning,

0 commit comments

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