MCPcopy Create free account
hub / github.com/Noumena-Network/code / isVertexAuthError

Function isVertexAuthError

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

Source from the content-addressed store, hash-verified

711}
712
713function isVertexAuthError(error: unknown): boolean {
714 if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) {
715 // SDK-level: google-auth-library fails in prepareOptions() before the HTTP call
716 if (isGoogleAuthLibraryCredentialError(error)) {
717 return true
718 }
719 // Server-side: Vertex returns 401 for expired/invalid tokens
720 if (error instanceof APIError && error.status === 401) {
721 return true
722 }
723 }
724 return false
725}
726
727/**
728 * Clear GCP auth caches if appropriate.

Callers 2

withRetryFunction · 0.85
handleGcpCredentialErrorFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.90

Tested by

no test coverage detected