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

Function emitUnhandledRejectionWarning

lib/internal/process/promises.js:225–246  ·  view source on GitHub ↗

* @param {PromiseInfo} promiseInfo

(promiseInfo)

Source from the content-addressed store, hash-verified

223 * @param {PromiseInfo} promiseInfo
224 */
225function emitUnhandledRejectionWarning(promiseInfo) {
226 const warning = new UnhandledPromiseRejectionWarning(promiseInfo.uid);
227 const reason = promiseInfo.reason;
228 try {
229 if (isErrorLike(reason)) {
230 warning.stack = reason.stack;
231 process.emitWarning(reason.stack, unhandledRejectionErrName);
232 } else {
233 process.emitWarning(
234 noSideEffectsToString(reason), unhandledRejectionErrName);
235 }
236 } catch {
237 try {
238 process.emitWarning(
239 noSideEffectsToString(reason), unhandledRejectionErrName);
240 } catch {
241 // Ignore.
242 }
243 }
244
245 process.emitWarning(warning);
246}
247
248/**
249 * @callback UnhandledRejectionsModeHandler

Calls 1

isErrorLikeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…