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

ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/master by this push:
     new 0730bfa2f CAY-2785 Modeler: improve folder selection for cgen  - 
improve error messages
0730bfa2f is described below

commit 0730bfa2f36d366e3836a82b9a4c2cd808c62845
Author: Nikita Timofeev <stari...@gmail.com>
AuthorDate: Tue Dec 6 17:51:22 2022 +0300

    CAY-2785 Modeler: improve folder selection for cgen
     - improve error messages
---
 .../main/java/org/apache/cayenne/gen/ClassGenerationAction.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java 
b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
index 7b0d4a314..0f828f5f6 100644
--- 
a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
+++ 
b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
@@ -276,22 +276,22 @@ public class ClassGenerationAction {
        protected void validateAttributes() {
                Path dir = cgenConfiguration.buildPath();
                if (dir == null) {
-                       throw new CayenneRuntimeException("'rootPath' attribute 
is missing.");
+                       throw new CayenneRuntimeException("Output directory is 
not set.");
                }
                if(Files.notExists(dir)) {
                        try {
                                Files.createDirectories(dir);
                        } catch (IOException e) {
-                               throw new CayenneRuntimeException("can't create 
directory");
+                               throw new CayenneRuntimeException("Can't create 
output directory '%s'", dir);
                        }
                }
 
                if (!Files.isDirectory(dir)) {
-                       throw new CayenneRuntimeException("'destDir' is not a 
directory.");
+                       throw new CayenneRuntimeException("'%s' is not a 
directory.", dir);
                }
 
                if (!Files.isWritable(dir)) {
-                       throw new CayenneRuntimeException("Do not have write 
permissions for %s", dir);
+                       throw new CayenneRuntimeException("No write permission 
for the output directory '%s'", dir);
                }
        }
 

Reply via email to