MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / handleRenderError

Function handleRenderError

packages/cli/src/commands/render.ts:1564–1601  ·  view source on GitHub ↗
(
  error: unknown,
  options: RenderOptions,
  startTime: number,
  docker: boolean,
  hint: string,
  failedStage?: string,
  job?: RenderJob,
)

Source from the content-addressed store, hash-verified

1562}
1563
1564function handleRenderError(
1565 error: unknown,
1566 options: RenderOptions,
1567 startTime: number,
1568 docker: boolean,
1569 hint: string,
1570 failedStage?: string,
1571 job?: RenderJob,
1572): never {
1573 const message = normalizeErrorMessage(error);
1574 trackRenderError({
1575 fps: fpsToNumber(options.fps),
1576 quality: options.quality,
1577 docker,
1578 workers: options.workers,
1579 gpu: options.gpu,
1580 authoringSkill: options.authoringSkill,
1581 elapsedMs: Date.now() - startTime,
1582 errorMessage: message,
1583 failedStage,
1584 ...renderJobObservabilityTelemetryPayload(job),
1585 ...getMemorySnapshot(),
1586 });
1587 if (options.throwOnError) {
1588 throw new Error(message);
1589 }
1590 // A `Failed to launch the browser process` / `libnss3.so cannot open ...`
1591 // failure on Linux/WSL is an environment problem, not a composition bug.
1592 // Replace the generic "Try --docker" hint with the exact per-distro
1593 // remediation and a pointer at `doctor`.
1594 const remediation = chromeLaunchRemediation(message);
1595 if (remediation) {
1596 errorBox("Render failed — Chrome could not launch", message, remediation);
1597 process.exit(1);
1598 }
1599 errorBox("Render failed", message, hint);
1600 process.exit(1);
1601}
1602
1603/**
1604 * Extract rich metrics from the completed render job and send to telemetry.

Callers 2

renderDockerFunction · 0.85
renderLocalFunction · 0.85

Calls 8

fpsToNumberFunction · 0.90
trackRenderErrorFunction · 0.85
getMemorySnapshotFunction · 0.85
chromeLaunchRemediationFunction · 0.85
errorBoxFunction · 0.85
nowMethod · 0.80
normalizeErrorMessageFunction · 0.50

Tested by

no test coverage detected