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

Function logError

code/dependency-injection/public/app.js:11272–11307  ·  view source on GitHub ↗
(boundary, errorInfo)

Source from the content-addressed store, hash-verified

11270
11271
11272function logError(boundary, errorInfo) {
11273 var source = errorInfo.source;
11274 var stack = errorInfo.stack;
11275 if (stack === null) {
11276 stack = getStackAddendumByWorkInProgressFiber(source);
11277 }
11278
11279 var capturedError = {
11280 componentName: source !== null ? getComponentName(source) : null,
11281 error: errorInfo.value,
11282 errorBoundary: boundary,
11283 componentStack: stack !== null ? stack : '',
11284 errorBoundaryName: null,
11285 errorBoundaryFound: false,
11286 willRetry: false
11287 };
11288
11289 if (boundary !== null) {
11290 capturedError.errorBoundaryName = getComponentName(boundary);
11291 capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent;
11292 } else {
11293 capturedError.errorBoundaryName = null;
11294 capturedError.errorBoundaryFound = capturedError.willRetry = false;
11295 }
11296
11297 try {
11298 logCapturedError(capturedError);
11299 } catch (e) {
11300 // Prevent cycle if logCapturedError() throws.
11301 // A cycle may still occur if logCapturedError renders a component that throws.
11302 var suppressLogging = e && e.suppressReactErrorLogging;
11303 if (!suppressLogging) {
11304 console.error(e);
11305 }
11306 }
11307}
11308
11309var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) {
11310 var getPublicInstance = config.getPublicInstance,

Callers 1

commitErrorLoggingFunction · 0.70

Calls 3

getComponentNameFunction · 0.70
logCapturedErrorFunction · 0.70

Tested by

no test coverage detected