Google API errors as typed findings, never raw JSON: cli/lib/google-errors.ts parses SERVICE_DISABLED (api-disabled: service, Cloud project, console page), PERMISSION_DENIED (no-app-access: which app, Users and permissions), 401 / invalid_grant (auth-revoked) and 429 (quota); health / analytics print one line with the URL, raw text in detail and the log; desktop Health tab: the line, 'Turn it on in Google Cloud' and 'Check again', raw text in a collapsed Details; Portfolio shows a Cloud project blocking several apps once. Findings exit codes are results: the sidecar reports outcome (ok / findings / declined / failed) and the command's own error line; scan / check / validate / health exit 1 with findings show and cache the findings; no bare 'Exit code N' anywhere. tests/google-errors.test.ts, boot check errors cases (api-disabled, scan-findings, scan-failed) (pitfall 57)

This commit is contained in:
CRTkafa 2026-10-13 23:20:04 +08:00
parent f69c10d3a0
commit 89256f1e80
28 changed files with 666 additions and 47 deletions

View file

@ -66,7 +66,25 @@ export const en = {
'common.unknown': 'Unknown',
'common.cancel': 'Cancel',
'common.close': 'Close',
'common.exit': 'Exit code {code}',
'common.exitNoMessage': 'The command stopped without an error message (exit {code}); the log has the details',
'gerr.apiDisabled': '{what} needs the {service} turned on in Google Cloud project {project}.',
'gerr.what.reporting': 'Crash and ANR data',
'gerr.what.publisher': 'Reading the app on Google Play',
'gerr.what.storage': 'Play statistics',
'gerr.what.other': 'This read',
'gerr.projectUnknown': '(the service account\'s project)',
'gerr.turnOn': 'Turn it on in Google Cloud',
'gerr.checkAgain': 'Check again',
'gerr.noAccess': 'The service account has no access to {app} in Play Console: add it under Users and permissions.',
'gerr.thisApp': 'this app',
'gerr.openUsers': 'Open Users and permissions',
'gerr.revoked': 'Google refused the service account key: it was revoked, deleted or has expired. Add a new JSON key in Accounts.',
'gerr.quota': 'The Google API quota is used up for now. Try again later.',
'gerr.details': 'Details',
'gerr.openFailed': 'Could not open the page',
'gerr.portfolio': '{count} Google Cloud projects need an API turned on: affects {apps}',
'gerr.portfolio_one': '1 Google Cloud project needs an API turned on: affects {apps}',
'gerr.portfolioProject': 'Project {project}: {service}',
'common.cachedFrom': 'Last read {when} (saved copy)',
'common.readWhen': 'Read {when}',
'common.readFailedKeep': 'The last read failed, so this shows the previous one: {error}',

View file

@ -68,7 +68,25 @@ export const tr: Record<keyof typeof en, string> = {
'common.unknown': 'Bilinmiyor',
'common.cancel': 'İptal',
'common.close': 'Kapat',
'common.exit': 'Çıkış kodu {code}',
'common.exitNoMessage': 'Komut bir hata mesajı vermeden durdu (çıkış {code}); ayrıntılar günlükte',
'gerr.apiDisabled': '{what} için Google Cloud projesi {project} içinde {service} açılmalı.',
'gerr.what.reporting': 'Çökme ve ANR verileri',
'gerr.what.publisher': 'Uygulamayı Google Play\'den okumak',
'gerr.what.storage': 'Play istatistikleri',
'gerr.what.other': 'Bu okuma',
'gerr.projectUnknown': '(hizmet hesabının projesi)',
'gerr.turnOn': 'Google Cloud\'da aç',
'gerr.checkAgain': 'Tekrar kontrol et',
'gerr.noAccess': 'Hizmet hesabının Play Console\'da {app} için erişimi yok: Kullanıcılar ve izinler bölümünden ekleyin.',
'gerr.thisApp': 'bu uygulama',
'gerr.openUsers': 'Kullanıcılar ve izinler\'i aç',
'gerr.revoked': 'Google hizmet hesabı anahtarını reddetti: iptal edilmiş, silinmiş ya da süresi dolmuş. Hesaplar\'da yeni bir JSON anahtarı ekleyin.',
'gerr.quota': 'Google API kotası şimdilik doldu. Daha sonra tekrar deneyin.',
'gerr.details': 'Ayrıntılar',
'gerr.openFailed': 'Sayfa açılamadı',
'gerr.portfolio': '{count} Google Cloud projesinde bir API açılmalı: etkilenenler {apps}',
'gerr.portfolio_one': '1 Google Cloud projesinde bir API açılmalı: etkilenenler {apps}',
'gerr.portfolioProject': 'Proje {project}: {service}',
'common.cachedFrom': 'Son okuma {when} (kayıtlı kopya)',
'common.readWhen': '{when} okundu',
'common.readFailedKeep': 'Son okuma başarısız oldu, bu yüzden bir öncekini gösteriyor: {error}',