Skip to content

InvalidArgumentError

Namespace: Vercel.AI.Util

public sealed class InvalidArgumentError : AiSdkError, ISerializable, IErrorMarkers

An argument failed validation. Message format matches the TypeScript SDK.

Inheritance: object → Exception → AiSdkError

Implements: ISerializable, IErrorMarkers

View source

InvalidArgumentError(string, object?, string)

Section titled “InvalidArgumentError(string, object?, string)”
public InvalidArgumentError(string parameter, object? value, string message)

Creates the error for <code class=“paramref”>parameter</code>.

Parameters

Name Type Description
parameter string
value object
message string

View source

public const string ErrorMarker = "vercel.ai.error.AI_InvalidArgumentError"

Marker for IsInstance(object).

Value: string

View source

public string Parameter { get; }

Parameter that failed validation.

Value: string

View source

public object? Value { get; }

Rejected value.

Value: object

View source

public static bool IsInstance(object? error)

Returns whether <code class=“paramref”>error</code> carries this error’s marker.

Parameters

Name Type Description
error object

Returns: bool

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product