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

Function errorHandler

lib/internal/modules/esm/worker.js:300–312  ·  view source on GitHub ↗

* Handles errors that occur in the worker thread. * @param {Error} err - The error that occurred. * @param {string} [origin] - The origin of the error.

(err, origin = 'unhandledRejection')

Source from the content-addressed store, hash-verified

298 * @param {string} [origin] - The origin of the error.
299 */
300 function errorHandler(err, origin = 'unhandledRejection') {
301 AtomicsAdd(lock, WORKER_TO_MAIN_THREAD_NOTIFICATION, 1);
302 AtomicsNotify(lock, WORKER_TO_MAIN_THREAD_NOTIFICATION);
303 process.off('uncaughtException', errorHandler);
304 if (hasUncaughtExceptionCaptureCallback()) {
305 process._fatalException(err);
306 return;
307 }
308 internalBinding('errors').triggerUncaughtException(
309 err,
310 origin === 'unhandledRejection',
311 );
312 }
313
314 return PromisePrototypeThen(
315 customizedModuleWorker(lock, syncCommPort, errorHandler),

Callers

nothing calls this directly

Calls 2

offMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…