MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isBedrockAuthError

Function isBedrockAuthError

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

Source from the content-addressed store, hash-verified

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