* 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).
()
| 192 | * callback (e.g., domain module). |
| 193 | */ |
| 194 | function 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 | |
| 209 | const kBufferedCommandSymbol = Symbol('bufferedCommand'); |
| 210 | const kLoadingSymbol = Symbol('loading'); |
no test coverage detected
searching dependent graphs…