Skip to content

Open source CapCut alternative.

TypeScript

fix(site): name the reason a shot failed

David Leda72061cbf90
diff --git a/site/src/cut/components/SceneCard.tsx b/site/src/cut/components/SceneCard.tsx
index e9ee55dd..a88b4e64 100644
--- a/site/src/cut/components/SceneCard.tsx
+++ b/site/src/cut/components/SceneCard.tsx
@@ -100,6 +100,9 @@ export function SceneCard({ threadId }: { threadId: string }) {
const creditsOut = run.shots.some(
(sh) => sh.status === "failed" && sh.error === NO_CREDITS_MESSAGE
);
+ // Why they held: the first failed shot's own error, so the notice names the
+ // cause instead of stating that something failed.
+ const stillReason = run.shots.find((sh) => sh.status === "failed" && sh.error)?.error;
// Elapsed clock: planning counts from the run start, rendering from approval;
// it stops at the end. Hidden while waiting for the user at the gate.
const clockAnchor = run.status === "planning" ? run.startedAt : run.renderStartedAt ?? run.startedAt;
@@ -190,8 +193,8 @@ export function SceneCard({ threadId }: { threadId: string }) {
<span>
{stillCount} of {run.shots.length} shot{run.shots.length === 1 ? "" : "s"} held a
still —{" "}
- {creditsOut ? (
- <HostedErrorText error={NO_CREDITS_MESSAGE} link={false} />
+ {creditsOut || stillReason ? (
+ <HostedErrorText error={creditsOut ? NO_CREDITS_MESSAGE : stillReason!} link={false} />
) : (
"video generation failed"
)}
diff --git a/site/src/cut/lib/genvideo/orchestrator.ts b/site/src/cut/lib/genvideo/orchestrator.ts
index 58ed9549..8c868a63 100644
--- a/site/src/cut/lib/genvideo/orchestrator.ts
+++ b/site/src/cut/lib/genvideo/orchestrator.ts
@@ -539,6 +539,12 @@ export class VideoOrchestrator {
if (attempt < VIDEO_ATTEMPTS) await this.sleep(BACKOFF_MS * attempt);
}
}
+ // Every take is spent. Say what the last one failed on: the run's own
+ // activity is where the user watched this shot, and "could not be generated"
+ // with no reason is not something anyone can act on.
+ if (shot.error) {
+ this.deps.emit({ type: "log", message: `Shot ${shot.id} failed — ${shot.error}` });
+ }
await this.placeFallback(shot); // never leave a hole
this.emitProgress();
}