(value: unknown)
| 458 | * Given a response that doesn't look quite right, see if it contains any known error types we can extract. |
| 459 | */ |
| 460 | export function extractUnknownErrorFormat(value: unknown): string | undefined { |
| 461 | // Check if value is a valid object first |
| 462 | if (!value || typeof value !== 'object') { |
| 463 | return undefined |
| 464 | } |
| 465 | |
| 466 | // Amazon Bedrock routing errors |
| 467 | if ((value as AmazonError).Output?.__type) { |
| 468 | return (value as AmazonError).Output!.__type |
| 469 | } |
| 470 | |
| 471 | return undefined |
| 472 | } |
| 473 | |
| 474 | export function getAssistantMessageFromError( |
| 475 | error: unknown, |
nothing calls this directly
no outgoing calls
no test coverage detected