(value: unknown)
| 409 | * Given a response that doesn't look quite right, see if it contains any known error types we can extract. |
| 410 | */ |
| 411 | export function extractUnknownErrorFormat(value: unknown): string | undefined { |
| 412 | // Check if value is a valid object first |
| 413 | if (!value || typeof value !== 'object') { |
| 414 | return undefined |
| 415 | } |
| 416 | |
| 417 | // Amazon Bedrock routing errors |
| 418 | if ((value as AmazonError).Output?.__type) { |
| 419 | return (value as AmazonError).Output!.__type |
| 420 | } |
| 421 | |
| 422 | return undefined |
| 423 | } |
| 424 | |
| 425 | export function getAssistantMessageFromError( |
| 426 | error: unknown, |
nothing calls this directly
no outgoing calls
no test coverage detected