GeezerVison is showing github.com — process: refs --unhandled-rejections documentation in warning message · nodejs/node@732780f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/process/promises.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -134,6 +134,9 @@ function emitUnhandledRejectionWarning(uid, reason) { |
134 | 134 | 'Unhandled promise rejection. This error originated either by ' + |
135 | 135 | 'throwing inside of an async function without a catch block, ' + |
136 | 136 | '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). ' + |
137 | 140 | `(rejection id: ${uid})` |
138 | 141 | ); |
139 | 142 | try { |
|
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' + |
12 | 12 | 'This error originated either by throwing ' + |
13 | 13 | 'inside of an async function without a catch ' + |
14 | 14 | '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)']; |
16 | 19 |
|
17 | 20 | function throwErr() { |
18 | 21 | throw new Error('Error from proxy'); |
|
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,10 @@ const expectedPromiseWarning = ['Unhandled promise rejection. ' + |
13 | 13 | 'This error originated either by throwing ' + |
14 | 14 | 'inside of an async function without a catch ' + |
15 | 15 | '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)']; |
17 | 20 |
|
18 | 21 | common.expectWarning({ |
19 | 22 | DeprecationWarning: expectedDeprecationWarning, |
|