ayushtkn commented on code in PR #6709:
URL: https://github.com/apache/hadoop/pull/6709#discussion_r1554546040


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java:
##########
@@ -1201,7 +1200,7 @@ private void lostFoundInit(DFSClient dfs) {
         lfInitedOk = true;
       }
     }  catch (Exception e) {
-      e.printStackTrace();
+      LOG.error(lfName + " dir init failed.", e);
       lfInitedOk = false;
     }

Review Comment:
   why do we need to catch the exception itself, can't we just throw. If I 
catch the logic, we catch the exception and set ``lfInitedOk`` to `false`  and 
then in the calling method we throw
   ```
         if (!lfInitedOk) {
           throw new IOException("failed to initialize lost+found");
         }
   ```
   Can't we directly throw. The client will get the exception, it will log or 
whatever rather than logging here



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to