googleapis / googleapis/google-cloud-java

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

Open
#12,616 11 comments 0 reactions 1 assignee Claimed by @silvolu View on GitHub
priority: p2 semver: major type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

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;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.