GatewayError
Namespace: Vercel.AI.Gateway
public abstract class GatewayError : AiSdkException, ISerializableBase class for AI Gateway errors. The message includes [generationId] when one was returned.
Inheritance: object → Exception → AiSdkException
Implements: ISerializable
Derived: GatewayAuthenticationError, GatewayFailedDependencyError, GatewayForbiddenError, GatewayInternalServerError, GatewayInvalidRequestError, GatewayModelNotFoundError, GatewayNotFoundError, GatewayRateLimitError, GatewayResponseError, GatewayTimeoutError
Constructors
Section titled “Constructors”GatewayError(string, int, Exception?, string?, bool?)
Section titled “GatewayError(string, int, Exception?, string?, bool?)”protected GatewayError(string message, int statusCode, Exception? cause, string? generationId, bool? isRetryable)Creates a Gateway error.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
statusCode |
int | |
cause |
Exception | |
generationId |
string | |
isRetryable |
bool? |
Properties
Section titled “Properties”public Exception? Cause { get; }Underlying failure, when one was supplied.
Value: Exception
GenerationId
Section titled “GenerationId”public string? GenerationId { get; }Gateway generation id.
Value: string
IsRetryable
Section titled “IsRetryable”public bool IsRetryable { get; }Whether the caller should retry this status.
Value: bool
StatusCode
Section titled “StatusCode”public int StatusCode { get; }HTTP status.
Value: int
public abstract string Type { get; }Gateway error type.
Value: string
Methods
Section titled “Methods”IsInstance(Exception?)
Section titled “IsInstance(Exception?)”public static bool IsInstance(Exception? error)True when <code class=“paramref”>error</code> is a Gateway error.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns: bool
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product