GatewayAuthenticationError
Namespace: Vercel.AI.Gateway
public sealed class GatewayAuthenticationError : GatewayError, ISerializableAuthentication failed.
Inheritance: object → Exception → AiSdkException → GatewayError
Implements: ISerializable
Constructors
Section titled “Constructors”GatewayAuthenticationError(string?, int, Exception?, string?)
Section titled “GatewayAuthenticationError(string?, int, Exception?, string?)”public GatewayAuthenticationError(string? message = null, int statusCode = 401, Exception? cause = null, string? generationId = null)Creates an authentication error. The default message is Authentication failed.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
statusCode |
int | |
cause |
Exception | |
generationId |
string |
Properties
Section titled “Properties”public override string Type { get; }Gateway error type.
Value: string
Methods
Section titled “Methods”CreateContextual(bool, bool, int, Exception?, string?)
Section titled “CreateContextual(bool, bool, int, Exception?, string?)”public static GatewayAuthenticationError CreateContextual(bool apiKeyProvided, bool oidcTokenProvided, int statusCode = 401, Exception? cause = null, string? generationId = null)Builds the message for an API key, an OIDC token, or missing credentials.
Parameters
| Name | Type | Description |
|---|---|---|
apiKeyProvided |
bool | |
oidcTokenProvided |
bool | |
statusCode |
int | |
cause |
Exception | |
generationId |
string |
Returns: GatewayAuthenticationError
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