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

Function isVertexAuthError

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

Source from the content-addressed store, hash-verified

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

Callers 2

withRetryFunction · 0.85
handleGcpCredentialErrorFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.50

Tested by

no test coverage detected