MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / logError

Function logError

code/higher-order-components/public/app.js:11173–11208  ·  view source on GitHub ↗
(boundary, errorInfo)

Source from the content-addressed store, hash-verified

11171
11172
11173function logError(boundary, errorInfo) {
11174 var source = errorInfo.source;
11175 var stack = errorInfo.stack;
11176 if (stack === null) {
11177 stack = getStackAddendumByWorkInProgressFiber(source);
11178 }
11179
11180 var capturedError = {
11181 componentName: source !== null ? getComponentName(source) : null,
11182 error: errorInfo.value,
11183 errorBoundary: boundary,
11184 componentStack: stack !== null ? stack : '',
11185 errorBoundaryName: null,
11186 errorBoundaryFound: false,
11187 willRetry: false
11188 };
11189
11190 if (boundary !== null) {
11191 capturedError.errorBoundaryName = getComponentName(boundary);
11192 capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent;
11193 } else {
11194 capturedError.errorBoundaryName = null;
11195 capturedError.errorBoundaryFound = capturedError.willRetry = false;
11196 }
11197
11198 try {
11199 logCapturedError(capturedError);
11200 } catch (e) {
11201 // Prevent cycle if logCapturedError() throws.
11202 // A cycle may still occur if logCapturedError renders a component that throws.
11203 var suppressLogging = e && e.suppressReactErrorLogging;
11204 if (!suppressLogging) {
11205 console.error(e);
11206 }
11207 }
11208}
11209
11210var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11211 var getPublicInstance = config.getPublicInstance,

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected