DownloadError
Namespace: Vercel.AI.Util
public sealed class DownloadError : AiSdkError, ISerializable, IErrorMarkersFailure while downloading a URL.
Inheritance: object → Exception → AiSdkError
Implements: ISerializable, IErrorMarkers
Constructors
Section titled “Constructors”DownloadError(string, string, int?, string?, Exception?)
Section titled “DownloadError(string, string, int?, string?, Exception?)”public DownloadError(string url, string message, int? statusCode = null, string? statusText = null, Exception? cause = null)Creates a download error.
Parameters
| Name | Type | Description |
|---|---|---|
url |
string | |
message |
string | |
statusCode |
int? | |
statusText |
string | |
cause |
Exception |
Fields
Section titled “Fields”ErrorMarker
Section titled “ErrorMarker”public const string ErrorMarker = "vercel.ai.error.AI_DownloadError"Marker for IsInstance(object).
Value: string
Properties
Section titled “Properties”StatusCode
Section titled “StatusCode”public int? StatusCode { get; }HTTP status, when the response was received.
Value: int?
StatusText
Section titled “StatusText”public string? StatusText { get; }HTTP status text, when the response was received.
Value: string
public string Url { get; }URL that failed.
Value: string
Methods
Section titled “Methods”FromCause(string, Exception)
Section titled “FromCause(string, Exception)”public static DownloadError FromCause(string url, Exception cause)Builds the message used when the transport throws.
Parameters
| Name | Type | Description |
|---|---|---|
url |
string | |
cause |
Exception |
Returns: DownloadError
FromStatus(string, int, string)
Section titled “FromStatus(string, int, string)”public static DownloadError FromStatus(string url, int statusCode, string statusText)Builds the message used for a non-success HTTP response.
Parameters
| Name | Type | Description |
|---|---|---|
url |
string | |
statusCode |
int | |
statusText |
string |
Returns: DownloadError
IsInstance(object?)
Section titled “IsInstance(object?)”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
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product