(boundary, errorInfo)
| 11212 | |
| 11213 | |
| 11214 | function logError(boundary, errorInfo) { |
| 11215 | var source = errorInfo.source; |
| 11216 | var stack = errorInfo.stack; |
| 11217 | if (stack === null) { |
| 11218 | stack = getStackAddendumByWorkInProgressFiber(source); |
| 11219 | } |
| 11220 | |
| 11221 | var capturedError = { |
| 11222 | componentName: source !== null ? getComponentName(source) : null, |
| 11223 | error: errorInfo.value, |
| 11224 | errorBoundary: boundary, |
| 11225 | componentStack: stack !== null ? stack : '', |
| 11226 | errorBoundaryName: null, |
| 11227 | errorBoundaryFound: false, |
| 11228 | willRetry: false |
| 11229 | }; |
| 11230 | |
| 11231 | if (boundary !== null) { |
| 11232 | capturedError.errorBoundaryName = getComponentName(boundary); |
| 11233 | capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent; |
| 11234 | } else { |
| 11235 | capturedError.errorBoundaryName = null; |
| 11236 | capturedError.errorBoundaryFound = capturedError.willRetry = false; |
| 11237 | } |
| 11238 | |
| 11239 | try { |
| 11240 | logCapturedError(capturedError); |
| 11241 | } catch (e) { |
| 11242 | // Prevent cycle if logCapturedError() throws. |
| 11243 | // A cycle may still occur if logCapturedError renders a component that throws. |
| 11244 | var suppressLogging = e && e.suppressReactErrorLogging; |
| 11245 | if (!suppressLogging) { |
| 11246 | console.error(e); |
| 11247 | } |
| 11248 | } |
| 11249 | } |
| 11250 | |
| 11251 | var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) { |
| 11252 | var getPublicInstance = config.getPublicInstance, |
no test coverage detected