MCPcopy Index your code
hub / github.com/react/react / logCommitErrored

Function logCommitErrored

packages/react-reconciler/src/ReactFiberPerformanceTrack.js:1379–1439  ·  view source on GitHub ↗
(
  startTime: number,
  endTime: number,
  errors: Array<CapturedValue<mixed>>,
  passive: boolean,
  debugTask: null | ConsoleTask,
)

Source from the content-addressed store, hash-verified

1377}
1378
1379export function logCommitErrored(
1380 startTime: number,
1381 endTime: number,
1382 errors: Array<CapturedValue<mixed>>,
1383 passive: boolean,
1384 debugTask: null | ConsoleTask,
1385): void {
1386 if (supportsUserTiming) {
1387 if (endTime <= startTime) {
1388 return;
1389 }
1390 if (__DEV__) {
1391 const properties: Array<[string, string]> = [];
1392 for (let i = 0; i < errors.length; i++) {
1393 const capturedValue = errors[i];
1394 const error = capturedValue.value;
1395 const message =
1396 typeof error === 'object' &&
1397 error !== null &&
1398 typeof error.message === 'string'
1399 ? // eslint-disable-next-line react-internal/safe-string-coercion
1400 String(error.message)
1401 : // eslint-disable-next-line react-internal/safe-string-coercion
1402 String(error);
1403 properties.push(['Error', message]);
1404 }
1405 const options: PerformanceMeasureOptions = {
1406 start: startTime,
1407 end: endTime,
1408 detail: {
1409 devtools: {
1410 color: 'error',
1411 track: currentTrack,
1412 trackGroup: LANES_TRACK_GROUP,
1413 tooltipText: passive
1414 ? 'Remaining Effects Errored'
1415 : 'Commit Errored',
1416 properties,
1417 },
1418 },
1419 };
1420 if (debugTask) {
1421 debugTask.run(
1422 // $FlowFixMe[method-unbinding]
1423 performance.measure.bind(performance, 'Errored', options),
1424 );
1425 } else {
1426 performance.measure('Errored', options);
1427 }
1428 } else {
1429 console.timeStamp(
1430 'Errored',
1431 startTime,
1432 endTime,
1433 currentTrack,
1434 LANES_TRACK_GROUP,
1435 'error',
1436 );

Callers 2

logCommitPhaseFunction · 0.85
logPassiveCommitPhaseFunction · 0.85

Calls 3

runMethod · 0.80
pushMethod · 0.65
measureMethod · 0.65

Tested by

no test coverage detected