tomtongue commented on code in PR #16859:
URL: https://github.com/apache/iceberg/pull/16859#discussion_r4739971044


##########
aliyun/src/main/java/org/apache/iceberg/aliyun/oss/OSSInputStream.java:
##########
@@ -147,7 +150,15 @@ private void openStream() throws IOException {
     closeStream();
 
     GetObjectRequest request = new GetObjectRequest(uri.bucket(), 
uri.key()).withRange(pos, -1);
-    stream = client.getObject(request).getObjectContent();
+    try {
+      stream = client.getObject(request).getObjectContent();
+    } catch (OSSException e) {
+      if (OSSErrorCode.NO_SUCH_KEY.equals(e.getErrorCode())) {
+        throw new NotFoundException(e, "Location does not exist: %s", uri);
+      }

Review Comment:
   Add the no such key exception handling here based on the comment 
https://github.com/apache/iceberg/pull/16859#discussion_r4461632424



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to