This is an automated email from the ASF dual-hosted git repository.

runzhiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new acdc209  RATIS-1304. Do not print error if ratis log is not yet 
created (#414)
acdc209 is described below

commit acdc20971850f9b9c7779276b8d7bf1527dca05d
Author: Elek, Márton <[email protected]>
AuthorDate: Fri Feb 5 00:46:25 2021 +0100

    RATIS-1304. Do not print error if ratis log is not yet created (#414)
---
 .../src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java
 
b/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java
index 4fe8a7b..25a0c4a 100644
--- 
a/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java
+++ 
b/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java
@@ -143,6 +143,8 @@ public class RaftStorageImpl implements RaftStorage {
     try (FileInputStream fio = new FileInputStream(confFile)) {
       LogEntryProto confProto = 
LogEntryProto.newBuilder().mergeFrom(fio).build();
       return LogProtoUtils.toRaftConfiguration(confProto);
+    } catch (FileNotFoundException e) {
+      return null;
     } catch (Exception e) {
       LOG.error("Failed reading configuration from file:" + confFile, e);
       return null;

Reply via email to