ayushtkn commented on code in PR #7829:
URL: https://github.com/apache/ozone/pull/7829#discussion_r1946297867


##########
hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/keys/PutKeyHandler.java:
##########
@@ -81,6 +81,9 @@ protected void execute(OzoneClient client, OzoneAddress 
address)
     String keyName = address.getKeyName();
 
     File dataFile = new File(fileName);
+    if (!dataFile.exists()) {
+      throw new IOException("Error: File not found: " + fileName);

Review Comment:
   I am bit curious on why are we throwing IOE here. isn't this a candidate for 
`FileNotFoundException` or maybe `OzoneClientException` like `GetKeyHandler` 
throws not for a same case but maybe kind of similar case
   
https://github.com/apache/ozone/blob/c187de0080c4b61827000d0fa35fb767f914962b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/keys/GetKeyHandler.java#L77-L78



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