AnthropicErrorData
Namespace: Vercel.AI.Anthropic
public sealed class AnthropicErrorDataParsed Anthropic error body. Extra fields such as details are dropped.
Inheritance: object
Constructors
Section titled “Constructors”AnthropicErrorData(bool, string?, string?, string?, string)
Section titled “AnthropicErrorData(bool, string?, string?, string?, string)”public AnthropicErrorData(bool success, string? type, string? errorType, string? message, string rawValue)Creates a parsed error.
Parameters
| Name | Type | Description |
|---|---|---|
success |
bool | |
type |
string | |
errorType |
string | |
message |
string | |
rawValue |
string |
Properties
Section titled “Properties”ErrorType
Section titled “ErrorType”public string? ErrorType { get; }Error type, such as overloaded_error.
Value: string
Message
Section titled “Message”public string? Message { get; }Error message.
Value: string
RawValue
Section titled “RawValue”public string RawValue { get; }Original JSON.
Value: string
Success
Section titled “Success”public bool Success { get; }True when the body matches { type: error, error: { type, message } }.
Value: bool
public string? Type { get; }Top-level type.
Value: string
Methods
Section titled “Methods”Parse(string)
Section titled “Parse(string)”public static AnthropicErrorData Parse(string json)Parses an error payload. A matching object succeeds even when extra properties are present.
Parameters
| Name | Type | Description |
|---|---|---|
json |
string |
Returns: AnthropicErrorData
Value()
Section titled “Value()”public JsonObject? Value()The validated value with only type and error.type/error.message.
Returns: JsonObject
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product