Skip to content

AmazonBedrockErrors

Namespace: Vercel.AI.AmazonBedrock

public static class AmazonBedrockErrors

Maps a Bedrock JSON error body onto the SDK exception hierarchy.

Inheritance: object

View source

public static ApiException Create(int statusCode, string? body)

Creates the status exception, using the Bedrock type prefix when the body has one.

Parameters

Name Type Description
statusCode int
body string

Returns: ApiException

View source

public static string? FormatMessage(string? body)

Returns the provider message. When type is present the message is {type}: {message}.

Parameters

Name Type Description
body string

Returns: string

View source

public static string? FormatMessage(JsonElement root)

Formats a parsed Bedrock error object.

Parameters

Name Type Description
root JsonElement

Returns: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product