MCPcopy
hub / github.com/facebook/react / logIOInfoErrored

Function logIOInfoErrored

packages/react-client/src/ReactFlightPerformanceTrack.js:530–579  ·  view source on GitHub ↗
(
  ioInfo: ReactIOInfo,
  rootEnv: string,
  error: mixed,
)

Source from the content-addressed store, hash-verified

528}
529
530export function logIOInfoErrored(
531 ioInfo: ReactIOInfo,
532 rootEnv: string,
533 error: mixed,
534): void {
535 const startTime = ioInfo.start;
536 const endTime = ioInfo.end;
537 if (supportsUserTiming && endTime >= 0) {
538 const description = getIODescription(error);
539 const entryName = getIOShortName(ioInfo, description, ioInfo.env, rootEnv);
540 const debugTask = ioInfo.debugTask;
541 if (__DEV__ && debugTask) {
542 const message =
543 typeof error === 'object' &&
544 error !== null &&
545 typeof error.message === 'string'
546 ? // eslint-disable-next-line react-internal/safe-string-coercion
547 String(error.message)
548 : // eslint-disable-next-line react-internal/safe-string-coercion
549 String(error);
550 const properties = [['rejected with', message]];
551 const tooltipText =
552 getIOLongName(ioInfo, description, ioInfo.env, rootEnv) + ' Rejected';
553 debugTask.run(
554 // $FlowFixMe[method-unbinding]
555 performance.measure.bind(performance, '\u200b' + entryName, {
556 start: startTime < 0 ? 0 : startTime,
557 end: endTime,
558 detail: {
559 devtools: {
560 color: 'error',
561 track: IO_TRACK,
562 properties,
563 tooltipText,
564 },
565 },
566 }),
567 );
568 } else {
569 console.timeStamp(
570 entryName,
571 startTime < 0 ? 0 : startTime,
572 endTime,
573 IO_TRACK,
574 undefined,
575 'error',
576 );
577 }
578 }
579}
580
581export function logIOInfo(
582 ioInfo: ReactIOInfo,

Callers 1

Calls 4

getIODescriptionFunction · 0.90
getIOShortNameFunction · 0.85
getIOLongNameFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected