diff options
| author | Tommaso Sciortino <[email protected]> | 2025-06-16 18:30:55 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-16 18:30:55 -0700 |
| commit | 98093e604a5aea86c8cde627808566a4fd7e5dd2 (patch) | |
| tree | 4ea5033e44f72e82730413a9b72e020a9cf78bcf | |
| parent | a7e45d47cda0b2b4f6325e8700434e7b2a2660ed (diff) | |
Simplify Error handling in Code Assist onboarding (#1123)
| -rw-r--r-- | packages/core/src/code_assist/setup.ts | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/packages/core/src/code_assist/setup.ts b/packages/core/src/code_assist/setup.ts index 6771bbcc..c2f0ef87 100644 --- a/packages/core/src/code_assist/setup.ts +++ b/packages/core/src/code_assist/setup.ts @@ -7,7 +7,6 @@ import { ClientMetadata, OnboardUserRequest } from './types.js'; import { CodeAssistServer } from './server.js'; import { OAuth2Client } from 'google-auth-library'; -import { GaxiosError } from 'gaxios'; import { clearCachedCredentials } from './oauth2.js'; /** @@ -53,17 +52,12 @@ export async function setupUser( return lroRes.response?.cloudaicompanionProject?.id || ''; } catch (e) { - if (e instanceof GaxiosError) { - const detail = e.response?.data?.error?.details[0].detail; - if (detail && detail.includes('projectID is empty')) { - await clearCachedCredentials(); - console.log( - '\n\nEnterprise users must specify GOOGLE_CLOUD_PROJECT ' + - 'in your environment variables or .env file.\n\n', - ); - process.exit(1); - } - } + await clearCachedCredentials(); + console.log( + '\n\nError onboarding with Code Assist.\n' + + 'Enterprise users must specify GOOGLE_CLOUD_PROJECT ' + + 'in their environment variables or .env file.\n\n', + ); throw e; } } |
