(fn)
| 113 | }; |
| 114 | |
| 115 | function setUncaughtExceptionCaptureCallback(fn) { |
| 116 | if (fn === null) { |
| 117 | exceptionHandlerState.captureFn = fn; |
| 118 | if (exceptionHandlerState.auxiliaryCallbacks.length === 0) { |
| 119 | shouldAbortOnUncaughtToggle[0] = 1; |
| 120 | process.report.reportOnUncaughtException = exceptionHandlerState.reportFlag; |
| 121 | } |
| 122 | return; |
| 123 | } |
| 124 | if (typeof fn !== 'function') { |
| 125 | throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'null'], fn); |
| 126 | } |
| 127 | if (exceptionHandlerState.captureFn !== null) { |
| 128 | throw new ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET(); |
| 129 | } |
| 130 | exceptionHandlerState.captureFn = fn; |
| 131 | shouldAbortOnUncaughtToggle[0] = 0; |
| 132 | exceptionHandlerState.reportFlag = |
| 133 | process.report.reportOnUncaughtException === true; |
| 134 | process.report.reportOnUncaughtException = false; |
| 135 | } |
| 136 | |
| 137 | // Add an auxiliary callback that coexists with the primary callback. |
| 138 | // Auxiliary callbacks are called first; if any returns true, the error is handled. |
no outgoing calls
no test coverage detected
searching dependent graphs…