pranavbhandari24 commented on code in PR #22079:
URL: https://github.com/apache/beam/pull/22079#discussion_r915111384


##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtil.java:
##########
@@ -640,6 +648,19 @@ boolean bucketAccessible(GcsPath path, BackOff backoff, 
Sleeper sleeper) throws
     }
   }
 
+  /**
+   * Checks whether the GCS bucket exists. Throws exception if the bucket is 
inaccessible due to
+   * permissions or does not exist.
+   */
+  @VisibleForTesting
+  void verifyBucketAccessible(GcsPath path, BackOff backoff, Sleeper sleeper) 
throws IOException {
+    try {
+      getBucket(path, backoff, sleeper);
+    } catch (AccessDeniedException | FileNotFoundException e) {
+      throw e;

Review Comment:
   Good catch! Removed the try-catch block.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to