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

Function setupExceptionCapture

lib/repl.js:194–207  ·  view source on GitHub ↗

* Sets up the uncaught exception capture callback to route errors * to the appropriate REPL instance. This replaces domain-based error handling. * Uses addUncaughtExceptionCaptureCallback to coexist with the primary * callback (e.g., domain module).

()

Source from the content-addressed store, hash-verified

192 * callback (e.g., domain module).
193 */
194function setupExceptionCapture() {
195 if (exceptionCaptureSetup) return;
196
197 process.addUncaughtExceptionCaptureCallback((err) => {
198 const store = replContext.getStore();
199 if (store?.replServer) {
200 const result = store.replServer._handleError(err);
201 return result !== 'unhandled'; // We handled it
202 }
203 // No active REPL context - let other handlers try
204 });
205
206 exceptionCaptureSetup = true;
207}
208
209const kBufferedCommandSymbol = Symbol('bufferedCommand');
210const kLoadingSymbol = Symbol('loading');

Callers 1

constructorMethod · 0.85

Calls 2

_handleErrorMethod · 0.80
getStoreMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…