MCPcopy Index your code
hub / github.com/microsoft/SandDance / captureCommitPhaseError

Function captureCommitPhaseError

docs/external/js/react-dom.development.js:23057–23093  ·  view source on GitHub ↗
(sourceFiber, error)

Source from the content-addressed store, hash-verified

23055 }
23056
23057 function captureCommitPhaseError(sourceFiber, error) {
23058 if (sourceFiber.tag === HostRoot) {
23059 // Error was thrown at the root. There is no parent, so the root
23060 // itself should capture it.
23061 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
23062 return;
23063 }
23064
23065 var fiber = sourceFiber.return;
23066
23067 while (fiber !== null) {
23068 if (fiber.tag === HostRoot) {
23069 captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
23070 return;
23071 } else if (fiber.tag === ClassComponent) {
23072 var ctor = fiber.type;
23073 var instance = fiber.stateNode;
23074
23075 if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
23076 var errorInfo = createCapturedValue(error, sourceFiber);
23077 var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync
23078 Sync);
23079 enqueueUpdate(fiber, update);
23080 var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
23081
23082 if (root !== null) {
23083 ensureRootIsScheduled(root);
23084 schedulePendingInteractions(root, Sync);
23085 }
23086
23087 return;
23088 }
23089 }
23090
23091 fiber = fiber.return;
23092 }
23093 }
23094 function pingSuspendedRoot(root, thenable, suspendedTime) {
23095 var pingCache = root.pingCache;
23096

Callers 5

safelyDetachRefFunction · 0.85
safelyCallDestroyFunction · 0.85
commitRootImplFunction · 0.85
flushPassiveEffectsImplFunction · 0.85

Calls 8

createCapturedValueFunction · 0.85
createClassErrorUpdateFunction · 0.85
enqueueUpdateFunction · 0.85
ensureRootIsScheduledFunction · 0.85

Tested by

no test coverage detected