MCPcopy Create free account
hub / github.com/freecodexyz/free-code / extractUnknownErrorFormat

Function extractUnknownErrorFormat

src/services/api/errors.ts:411–423  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

409 * Given a response that doesn't look quite right, see if it contains any known error types we can extract.
410 */
411export 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
425export function getAssistantMessageFromError(
426 error: unknown,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected