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

Function logError

code/event-handlers/public/app.js:10509–10544  ·  view source on GitHub ↗
(boundary, errorInfo)

Source from the content-addressed store, hash-verified

10507
10508
10509function logError(boundary, errorInfo) {
10510 var source = errorInfo.source;
10511 var stack = errorInfo.stack;
10512 if (stack === null) {
10513 stack = getStackAddendumByWorkInProgressFiber(source);
10514 }
10515
10516 var capturedError = {
10517 componentName: source !== null ? getComponentName(source) : null,
10518 error: errorInfo.value,
10519 errorBoundary: boundary,
10520 componentStack: stack !== null ? stack : '',
10521 errorBoundaryName: null,
10522 errorBoundaryFound: false,
10523 willRetry: false
10524 };
10525
10526 if (boundary !== null) {
10527 capturedError.errorBoundaryName = getComponentName(boundary);
10528 capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent;
10529 } else {
10530 capturedError.errorBoundaryName = null;
10531 capturedError.errorBoundaryFound = capturedError.willRetry = false;
10532 }
10533
10534 try {
10535 logCapturedError(capturedError);
10536 } catch (e) {
10537 // Prevent cycle if logCapturedError() throws.
10538 // A cycle may still occur if logCapturedError renders a component that throws.
10539 var suppressLogging = e && e.suppressReactErrorLogging;
10540 if (!suppressLogging) {
10541 console.error(e);
10542 }
10543 }
10544}
10545
10546var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
10547 var getPublicInstance = config.getPublicInstance,

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected