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

Function isVertexAuthError

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

Source from the content-addressed store, hash-verified

664}
665
666function isVertexAuthError(error: unknown): boolean {
667 if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) {
668 // SDK-level: google-auth-library fails in prepareOptions() before the HTTP call
669 if (isGoogleAuthLibraryCredentialError(error)) {
670 return true
671 }
672 // Server-side: Vertex returns 401 for expired/invalid tokens
673 if (error instanceof APIError && error.status === 401) {
674 return true
675 }
676 }
677 return false
678}
679
680/**
681 * 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