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

Function handledRejection

lib/internal/process/promises.js:203–218  ·  view source on GitHub ↗

* @param {Promise} promise

(promise)

Source from the content-addressed store, hash-verified

201 * @param {Promise} promise
202 */
203function handledRejection(promise) {
204 if (pendingUnhandledRejections.has(promise)) {
205 pendingUnhandledRejections.delete(promise);
206 return;
207 }
208 const promiseInfo = maybeUnhandledPromises.get(promise);
209 if (promiseInfo !== undefined) {
210 maybeUnhandledPromises.delete(promise);
211 if (promiseInfo.warned) {
212 // Generate the warning object early to get a good stack trace.
213 const warning = new PromiseRejectionHandledWarning(promiseInfo.uid);
214 asyncHandledRejections.push({ promise, warning });
215 setHasRejectionToWarn(true);
216 }
217 }
218}
219
220const unhandledRejectionErrName = UnhandledPromiseRejectionWarning.name;
221

Callers 1

promiseRejectHandlerFunction · 0.85

Calls 5

setHasRejectionToWarnFunction · 0.85
hasMethod · 0.65
deleteMethod · 0.65
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…