* 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')
| 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), |
nothing calls this directly
no test coverage detected
searching dependent graphs…