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 failed", 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to