{"record":{"id":"323325819b78376e","repo":"vercel/ai","slug":"statusresult-error","errorCode":null,"errorMessage":"statusResult.error","messagePattern":"statusResult\\.error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/ai/src/generate-video/generate-video.ts","lineNumber":574,"sourceCode":"      }\n      await delay(Math.min(intervalMs, timeoutMs - elapsedMs), {\n        abortSignal: callOptions.abortSignal,\n      });\n      if (Date.now() - startTime >= timeoutMs) {\n        throw new Error(`Video generation timed out after ${timeoutMs}ms.`);\n      }\n    }\n\n    const statusResult = await retry(() =>\n      model.doStatus!({\n        operation: startResult.operation,\n        abortSignal: callOptions.abortSignal,\n        headers: callOptions.headers,\n      }),\n    );\n\n    if (statusResult.status === 'error') {\n      throw new Error(statusResult.error);\n    }\n\n    if (statusResult.warnings != null) {\n      allWarnings.push(...statusResult.warnings);\n    }\n    if (statusResult.providerMetadata != null) {\n      operationProviderMetadata ??= {};\n      mergeProviderMetadata(\n        operationProviderMetadata,\n        statusResult.providerMetadata,\n      );\n    }\n\n    if (statusResult.status === 'completed') {\n      return {\n        videos: statusResult.videos,\n        warnings: allWarnings,\n        providerMetadata: operationProviderMetadata,","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/ai/src/generate-video/generate-video.ts#L556-L592","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Read statusResult.error (the thrown message) to see the provider's failure reason and fix the request accordingly (prompt, size, duration).","Retry the generation; some provider failures are transient.","Check provider quota/billing if errors persist.","Handle the failure in your UI/log by wrapping the start/status flow in try-catch."],"exampleFix":"// before\nconst op = await experimental_startVideo({ model: provider.video('m'), prompt });\nconst { video } = await op;\n// after\ntry {\n  const op = await experimental_startVideo({ model: provider.video('m'), prompt });\n  const { video } = await op;\n} catch (e) {\n  console.error('Video job failed:', e.message); // inspect provider reason, adjust request\n}","handlingStrategy":"try-catch","validationCode":"// verify the model supports async start/status before starting\nif (typeof model.doStatus !== 'function') throw new Error('pick an async-capable video model');","typeGuard":"function supportsVideoStatus(model) {\n  return typeof model?.doStatus === 'function';\n}","tryCatchPattern":"try {\n  const { video } = await op;\n} catch (e) {\n  // e.message carries the provider's failure reason from statusResult.error\n  logger.error('video job failed', e.message);\n  // adjust prompt/params or retry with a new startVideo call\n}","preventionTips":["Validate prompt/size/duration against the provider's constraints before starting.","Monitor provider quotas and billing to avoid job failures.","Treat job failures as retryable only when the provider reason indicates transience.","Log the provider error message for diagnostics."],"tags":["video","provider-error","async-status"],"backgroundTag":"video-generation-job-failed","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}