Back to Ai

AI_NoContentGeneratedError

content/docs/07-reference/05-ai-sdk-errors/ai-no-content-generated-error.mdx

2.1.10440 B
Original Source

AI_NoContentGeneratedError

This error occurs when the AI provider fails to generate content.

Properties

  • message: The error message (optional, defaults to 'No content generated.')

Checking for this Error

You can check if an error is an instance of AI_NoContentGeneratedError using:

typescript
import { NoContentGeneratedError } from 'ai';

if (NoContentGeneratedError.isInstance(error)) {
  // Handle the error
}