googleapis / googleapis/google-cloud-java

[google-auth-library-java] ComputeEngineCredentials incorrectly throws RuntimeException

Offen
#12,616 11 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @silvolu Auf GitHub ansehen
priority: p2 semver: major type: feature request
Vorherrschende Sprache
Java
Sterne
2.1k
Forks
1.2k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
154

Beschreibung

Unless we really think getDefaultServiceAccount can't fail here, we should not convert the IOException to a RuntimeException.

```
@Override
public String getAccount() {
if (serviceAccountEmail == null) {
try {
serviceAccountEmail = getDefaultServiceAccount();
} catch (IOException ex) {
throw new RuntimeException("Failed to to get service account", ex);
}
}
return serviceAccountEmail;
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.