ApiCallException
Namespace: E2E.Decision.Sdk
public sealed class ApiCallException : Exception, ISerializableThe AI SDK’s APICallError: a provider call that failed. RunAsync retries it when
IsRetryable, waiting for the provider’s retry-after-ms or retry-after header when it is reasonable.
Inheritance: object → Exception
Implements: ISerializable
Constructors
Section titled “Constructors”ApiCallException(string, int?, IReadOnlyDictionary<string, string>?, bool?, Exception?)
Section titled “ApiCallException(string, int?, IReadOnlyDictionary<string, string>?, bool?, Exception?)”public ApiCallException(string message, int? statusCode = null, IReadOnlyDictionary<string, string>? responseHeaders = null, bool? isRetryable = null, Exception? innerException = null)The AI SDK’s APICallError: a provider call that failed. RunAsync retries it when
IsRetryable, waiting for the provider’s retry-after-ms or retry-after header when it is reasonable.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
statusCode |
int? | |
responseHeaders |
IReadOnlyDictionary<string, string> | |
isRetryable |
bool? | |
innerException |
Exception |
Properties
Section titled “Properties”IsRetryable
Section titled “IsRetryable”public bool IsRetryable { get; }Whether the call may be sent again. Upstream’s default: no answer at all, or a 408, 409, 429, or 5xx.
Value: bool
ParsedData
Section titled “ParsedData”public JsonElement? ParsedData { get; init; }The body the provider SDK already parsed, when it did (upstream APICallError.data; Exception.Data is taken). Null means there is none.
Value: JsonElement?
ResponseBody
Section titled “ResponseBody”public string? ResponseBody { get; init; }The body of the provider’s answer, when it sent one.
Value: string
ResponseHeaders
Section titled “ResponseHeaders”public IReadOnlyDictionary<string, string>? ResponseHeaders { get; }The provider’s response headers, lowercase names.
Value: IReadOnlyDictionary<string, string>
StatusCode
Section titled “StatusCode”public int? StatusCode { get; }The HTTP status of the provider’s answer; null when no answer came.
Value: int?