Skip to main content

AI_TypeValidationError

还没翻译译自英文(ai-sdk.dev)本页 6 段都还没译

This error occurs when type validation fails.

Properties

  • value: The value that failed validation
  • cause: The underlying validation error (required in constructor)

Checking for this Error

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

import { TypeValidationError } from 'ai';

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