Skip to content

Commit 5732bd3

Browse files
committed
improve error handling
1 parent ac8e996 commit 5732bd3

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/io/openapiprocessor/maven/ProcessMojo.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void execute () throws MojoExecutionException, MojoFailureException {
5757
}
5858
}
5959

60-
private Map<String, Object> createProperties () {
60+
private Map<String, Object> createProperties () throws MojoExecutionException {
6161
Map<String, Object> properties = new HashMap<> ();
6262

6363
addProperties (options, properties);
@@ -94,14 +94,19 @@ private void addNestedProperties (Nested nested, Map<String, Object> parent) {
9494
}
9595

9696
// copy common api path to openapi-processor props if not set
97-
private void setApiPath (Map<String, Object> properties) {
97+
private void setApiPath (Map<String, Object> properties) throws MojoExecutionException {
9898
if (!properties.containsKey (API_PATH)) {
9999
if (apiPath == null) {
100-
warnMissingApiPath();
101-
return;
100+
throw new MojoExecutionException (this,
101+
"'common <apiPath>' or '" + id + " <apiPath>' not set!",
102+
"'common <apiPath>' or '" + id + " <apiPath>' not set!");
103+
// warnMissingApiPath();
104+
// return;
102105
}
103106

104107
properties.put (API_PATH, apiPath);
108+
} else {
109+
apiPath = new File((String) properties.get (API_PATH));
105110
}
106111
}
107112

0 commit comments

Comments
 (0)