MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / logError

Function logError

code/composition/public/app.js:11317–11352  ·  view source on GitHub ↗
(boundary, errorInfo)

Source from the content-addressed store, hash-verified

11315
11316
11317function logError(boundary, errorInfo) {
11318 var source = errorInfo.source;
11319 var stack = errorInfo.stack;
11320 if (stack === null) {
11321 stack = getStackAddendumByWorkInProgressFiber(source);
11322 }
11323
11324 var capturedError = {
11325 componentName: source !== null ? getComponentName(source) : null,
11326 error: errorInfo.value,
11327 errorBoundary: boundary,
11328 componentStack: stack !== null ? stack : '',
11329 errorBoundaryName: null,
11330 errorBoundaryFound: false,
11331 willRetry: false
11332 };
11333
11334 if (boundary !== null) {
11335 capturedError.errorBoundaryName = getComponentName(boundary);
11336 capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent;
11337 } else {
11338 capturedError.errorBoundaryName = null;
11339 capturedError.errorBoundaryFound = capturedError.willRetry = false;
11340 }
11341
11342 try {
11343 logCapturedError(capturedError);
11344 } catch (e) {
11345 // Prevent cycle if logCapturedError() throws.
11346 // A cycle may still occur if logCapturedError renders a component that throws.
11347 var suppressLogging = e && e.suppressReactErrorLogging;
11348 if (!suppressLogging) {
11349 console.error(e);
11350 }
11351 }
11352}
11353
11354var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11355 var getPublicInstance = config.getPublicInstance,

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected