vercel/ai · error

statusResult.error

Error message

statusResult.error

What it means

During the polling/status phase of an async video generation, the provider's doStatus call returned a status of 'error'. generate-video surfaces the provider-supplied error message by throwing a plain Error containing statusResult.error. This means the remote video job itself failed, not a local SDK problem.

Source

Thrown at packages/ai/src/generate-video/generate-video.ts:574

      }
      await delay(Math.min(intervalMs, timeoutMs - elapsedMs), {
        abortSignal: callOptions.abortSignal,
      });
      if (Date.now() - startTime >= timeoutMs) {
        throw new Error(`Video generation timed out after ${timeoutMs}ms.`);
      }
    }

    const statusResult = await retry(() =>
      model.doStatus!({
        operation: startResult.operation,
        abortSignal: callOptions.abortSignal,
        headers: callOptions.headers,
      }),
    );

    if (statusResult.status === 'error') {
      throw new Error(statusResult.error);
    }

    if (statusResult.warnings != null) {
      allWarnings.push(...statusResult.warnings);
    }
    if (statusResult.providerMetadata != null) {
      operationProviderMetadata ??= {};
      mergeProviderMetadata(
        operationProviderMetadata,
        statusResult.providerMetadata,
      );
    }

    if (statusResult.status === 'completed') {
      return {
        videos: statusResult.videos,
        warnings: allWarnings,
        providerMetadata: operationProviderMetadata,

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Read statusResult.error (the thrown message) to see the provider's failure reason and fix the request accordingly (prompt, size, duration).
  2. Retry the generation; some provider failures are transient.
  3. Check provider quota/billing if errors persist.
  4. Handle the failure in your UI/log by wrapping the start/status flow in try-catch.

Example fix

// before
const op = await experimental_startVideo({ model: provider.video('m'), prompt });
const { video } = await op;
// after
try {
  const op = await experimental_startVideo({ model: provider.video('m'), prompt });
  const { video } = await op;
} catch (e) {
  console.error('Video job failed:', e.message); // inspect provider reason, adjust request
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the model supports async start/status before starting
if (typeof model.doStatus !== 'function') throw new Error('pick an async-capable video model');

Type guard

function supportsVideoStatus(model) {
  return typeof model?.doStatus === 'function';
}

Try / catch

try {
  const { video } = await op;
} catch (e) {
  // e.message carries the provider's failure reason from statusResult.error
  logger.error('video job failed', e.message);
  // adjust prompt/params or retry with a new startVideo call
}

Prevention

When it happens

Trigger: Using experimental_startVideo or generateVideo with a model that has an async start/status flow; polling reaches a statusResult with status==='error' (job failed, content policy rejection, provider-side processing error).

Common situations: Provider rejected the prompt or content policy; the video job failed upstream (e.g. invalid resolution/duration combination); provider quota or account issue discovered at poll time; transient provider failure during the job.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/323325819b78376e. Report an issue: GitHub.