MCPcopy Index your code
hub / github.com/nodejs/node / constructor

Method constructor

lib/internal/process/promises.js:65–85  ·  view source on GitHub ↗

* @param {number} uid

(uid)

Source from the content-addressed store, hash-verified

63 * @param {number} uid
64 */
65 constructor(uid) {
66 const message = 'Unhandled promise rejection. This error originated either by ' +
67 'throwing inside of an async function without a catch block, ' +
68 'or by rejecting a promise which was not handled with .catch(). ' +
69 'To terminate the node process on unhandled promise ' +
70 'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' +
71 'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ' +
72 `(rejection id: ${uid})`;
73
74 // UnhandledPromiseRejectionWarning will get the stack trace from the
75 // reason, so we can disable the stack trace limit temporarily for better
76 // performance.
77 if (isErrorStackTraceLimitWritable()) {
78 const stackTraceLimit = Error.stackTraceLimit;
79 Error.stackTraceLimit = 0;
80 super(message);
81 Error.stackTraceLimit = stackTraceLimit;
82 } else {
83 super(message);
84 }
85 }
86}
87
88class PromiseRejectionHandledWarning extends Error {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected