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

Function logError

code/styling/public/app.js:11179–11214  ·  view source on GitHub ↗
(boundary, errorInfo)

Source from the content-addressed store, hash-verified

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

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected