GatewayResponseError
Namespace: Vercel.AI.Gateway
public sealed class GatewayResponseError : GatewayError, ISerializableThe Gateway error body could not be read.
Inheritance: object → Exception → AiSdkException → GatewayError
Implements: ISerializable
Constructors
Section titled “Constructors”GatewayResponseError(string?, int, JsonElement?, string?, Exception?, string?, bool?)
Section titled “GatewayResponseError(string?, int, JsonElement?, string?, Exception?, string?, bool?)”public GatewayResponseError(string? message = null, int statusCode = 502, JsonElement? response = null, string? validationError = null, Exception? cause = null, string? generationId = null, bool? isRetryable = null)Creates a response error.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
statusCode |
int | |
response |
JsonElement? | |
validationError |
string | |
cause |
Exception | |
generationId |
string | |
isRetryable |
bool? |
Properties
Section titled “Properties”Response
Section titled “Response”public JsonElement? Response { get; }Raw response body.
Value: JsonElement?
public override string Type { get; }Gateway error type.
Value: string
ValidationError
Section titled “ValidationError”public string? ValidationError { get; }Why the body was rejected.
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 this error.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns: bool
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product