kwin commented on a change in pull request #186:
URL: 
https://github.com/apache/jackrabbit-filevault/pull/186#discussion_r767799908



##########
File path: 
vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/registry/impl/FSInstallStateCache.java
##########
@@ -55,8 +60,13 @@
     private final Path homeDir;
 
     public FSInstallStateCache(Path homeDir) throws IOException {
-        this.homeDir = homeDir;
-        Files.createDirectories(homeDir.toRealPath());
+        try {
+            this.homeDir = homeDir;
+            Files.createDirectories(homeDir.toRealPath());
+        } catch (FileAlreadyExistsException ex) {
+            log.error("on createDirectories for " + homeDir + " (real path: " 
+ homeDir.toRealPath() + ")", ex);

Review comment:
       Let us rather wrap the original exception and add this detail message. 
Both throwing and logging is an antipattern and leads to redundant log entries. 




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


Reply via email to