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

Function isVertexAuthError

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

Source from the content-addressed store, hash-verified

668}
669
670function isVertexAuthError(error: unknown): boolean {
671 if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) {
672 // SDK-level: google-auth-library fails in prepareOptions() before the HTTP call
673 if (isGoogleAuthLibraryCredentialError(error)) {
674 return true
675 }
676 // Server-side: Vertex returns 401 for expired/invalid tokens
677 if (error instanceof APIError && error.status === 401) {
678 return true
679 }
680 }
681 return false
682}
683
684/**
685 * Clear GCP auth caches if appropriate.

Callers 2

withRetryFunction · 0.85
handleGcpCredentialErrorFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected