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

Function logError

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

Source from the content-addressed store, hash-verified

11212
11213
11214function 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
11251var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11252 var getPublicInstance = config.getPublicInstance,

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected