MCPcopy Create free account
hub / github.com/IIIIQIIII/claude-code / isBedrockAuthError

Function isBedrockAuthError

src/services/api/withRetry.ts:627–640  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

625}
626
627function isBedrockAuthError(error: unknown): boolean {
628 if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)) {
629 // AWS libs reject without an API call if .aws holds a past Expiration value
630 // otherwise, API calls that receive expired tokens give generic 403
631 // "The security token included in the request is invalid"
632 if (
633 isAwsCredentialsProviderError(error) ||
634 (error instanceof APIError && error.status === 403)
635 ) {
636 return true
637 }
638 }
639 return false
640}
641
642/**
643 * Clear AWS auth caches if appropriate.

Callers 2

withRetryFunction · 0.85
handleAwsCredentialErrorFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected