@@ -67,7 +67,7 @@ public FileSystemBlockStorage(final String key, final Config config) throws IOEx
67
67
Files .createDirectory (blockNodeRootPath );
68
68
LOGGER .log (System .Logger .Level .INFO , "Created block node root directory: " + blockNodeRootPath );
69
69
} else {
70
- LOGGER .log (System .Logger .Level .INFO , "Block node root directory exists : " + blockNodeRootPath );
70
+ LOGGER .log (System .Logger .Level .INFO , "Using existing block node root directory: " + blockNodeRootPath );
71
71
}
72
72
}
73
73
@@ -84,12 +84,11 @@ public Optional<Long> write(final BlockStreamServiceGrpcProto.Block block) {
84
84
85
85
try (FileOutputStream fos = new FileOutputStream (fullPath )) {
86
86
block .writeTo (fos );
87
- LOGGER .log (System .Logger .Level .DEBUG , "Wrote the block file: " + fullPath );
87
+ LOGGER .log (System .Logger .Level .DEBUG , "Successfully wrote the block file: " + fullPath );
88
88
89
89
return Optional .of (id );
90
- }
91
- catch (IOException e ) {
92
- LOGGER .log (System .Logger .Level .ERROR , "Error writing the protobuf to file: " + e .getMessage ());
90
+ } catch (IOException e ) {
91
+ LOGGER .log (System .Logger .Level .ERROR , "Error writing the protobuf to a file" , e );
93
92
return Optional .empty ();
94
93
}
95
94
}
@@ -110,7 +109,7 @@ private Optional<BlockStreamServiceGrpcProto.Block> read(final String filePath)
110
109
try (FileInputStream fis = new FileInputStream (filePath )) {
111
110
return Optional .of (BlockStreamServiceGrpcProto .Block .parseFrom (fis ));
112
111
} catch (FileNotFoundException io ) {
113
- LOGGER .log (System .Logger .Level .ERROR , "Error reading file: " + filePath );
112
+ LOGGER .log (System .Logger .Level .ERROR , "Error reading file: " + filePath , io );
114
113
return Optional .empty ();
115
114
} catch (IOException io ) {
116
115
throw new RuntimeException ("Error reading file: " + filePath , io );
0 commit comments