Skip to content

Commit 0eada88

Browse files
author
Ajay Kannan
committed
minor fixes
1 parent 1e7e152 commit 0eada88

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ResourceManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ public static ProjectListOption fields(ProjectField... fields) {
213213
/**
214214
* Retrieves the project identified by the specified project ID.
215215
*
216-
* <p>The caller must have read permissions for this project. Returns {@code null} if project
217-
* not found.
216+
* <p>Returns {@code null} if the project is not found or if the user doesn't have read
217+
* permissions for the project.
218218
*
219219
* @see <a
220220
* href="https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/get">Cloud

gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/DefaultResourceManagerRpc.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public Project get(String projectId, Map<Option, ?> options) throws ResourceMana
8989
} catch (IOException ex) {
9090
ResourceManagerException translated = translate(ex);
9191
if (translated.code() == HTTP_FORBIDDEN || translated.code() == HTTP_NOT_FOUND) {
92-
return null; // Project not found
92+
// Service can return either 403 or 404 to signify that the project doesn't exist.
93+
return null;
9394
} else {
9495
throw translated;
9596
}

0 commit comments

Comments
 (0)