Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
process: refs --unhandled-rejections documentation in warning message
Refs: #20392
  • Loading branch information
aduh95 committed Nov 20, 2019
commit 3ef5662b624beb225eb4d2b17e270bc850e3c19b
3 changes: 3 additions & 0 deletions lib/internal/process/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ function emitUnhandledRejectionWarning(uid, reason) {
'Unhandled promise rejection. This error originated either by ' +
'throwing inside of an async function without a catch block, ' +
'or by rejecting a promise which was not handled with .catch(). ' +
'If you want node process to terminate on unhandled promise ' +
Comment thread
aduh95 marked this conversation as resolved.
Outdated
'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' +
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ' +
`(rejection id: ${uid})`
);
try {
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-promises-unhandled-proxy-rejections.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' +
'This error originated either by throwing ' +
'inside of an async function without a catch ' +
'block, or by rejecting a promise which was ' +
'not handled with .catch(). (rejection id: 1)'];
'not handled with .catch(). If you want node ' +
'process to terminate on unhandled promise ' +
Comment thread
aduh95 marked this conversation as resolved.
Outdated
'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' +
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)'];

function throwErr() {
throw new Error('Error from proxy');
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-promises-unhandled-symbol-rejections.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' +
'This error originated either by throwing ' +
'inside of an async function without a catch ' +
'block, or by rejecting a promise which was ' +
'not handled with .catch(). (rejection id: 1)'];
'not handled with .catch(). If you want node ' +
Comment thread
aduh95 marked this conversation as resolved.
Outdated
'process to terminate on unhandled promise ' +
'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' +
'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)'];

common.expectWarning({
DeprecationWarning: expectedDeprecationWarning,
Expand Down