You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/07/07 15:07:31 UTC

[GitHub] [camel] orpiske commented on a change in pull request #5787: Fixes based on the run of the static analysis tool Findbugs

orpiske commented on a change in pull request #5787:
URL: https://github.com/apache/camel/pull/5787#discussion_r665462532



##########
File path: core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/FileStateRepository.java
##########
@@ -207,7 +207,10 @@ protected void loadStore() throws IOException {
             LOG.debug("Creating filestore: {}", fileStore);
             File parent = fileStore.getParentFile();
             if (parent != null) {
-                parent.mkdirs();
+                boolean mkdirsResult = parent.mkdirs();
+                if (!mkdirsResult) {
+                    LOG.error("mkdirs() failed for " + parent);

Review comment:
       My .2 cents: I think it would be better to have a more descriptive log message here since this is in the core of Camel and also using log markers. I'd suggest something like `LOG.error(""Couldn't create the filestore at {} because creating the directory has f" + parent);`. Alternatively, we could also explore whether [Files.createDirectories](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#createDirectories-java.nio.file.Path-java.nio.file.attribute.FileAttribute...-) could fulfill this gaps as, I believe, it provides better error descriptions.




-- 
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: commits-unsubscribe@camel.apache.org

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