( startTime: number, endTime: number, errors: Array<CapturedValue<mixed>>, passive: boolean, debugTask: null | ConsoleTask, )
| 1377 | } |
| 1378 | |
| 1379 | export 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 | ); |
no test coverage detected