gargvishesh commented on code in PR #16047:
URL: https://github.com/apache/druid/pull/16047#discussion_r1512616578


##########
extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleStorage.java:
##########
@@ -144,12 +147,19 @@ public GoogleStorageObjectMetadata getMetadata(
 
   public void delete(final String bucket, final String path) throws IOException
   {
+    // Though currently not documented for the GCS delete api, a false 
response is indicative of file not found.
+    // All other errors appear as StorageException which is a runtime 
exceptions. Refer to
+    // 
https://github.com/googleapis/java-storage/blob/0b5f11af941032e6a55b12d243acf128a6464400/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java#L685
     if (!storage.get().delete(bucket, path)) {
-      throw new IOE(
-          "Failed deleting google cloud storage object [bucket: %s path: %s]",
-          bucket,
-          path
-      );
+      throw new HttpResponseException.Builder(

Review Comment:
   I think returning the boolean (directly from the GCS call) will suffice, 
which can be checked if required. `deleteIfPresent` not checking the return 
value would implicitly correspond to delete-only-if-file-exists behaviour.



-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to