Skip to content

Commit

Permalink
Merge pull request #211 from groovy/210
Browse files Browse the repository at this point in the history
Throw exception instead of returning null when Groovy can't be found (closes #210)
  • Loading branch information
keeganwitt authored Feb 15, 2022
2 parents 87fd2ca + 6545e00 commit 8f7f74e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/codehaus/gmavenplus/util/ClassWrangler.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ public Version getGroovyVersion() {
try {
return Version.parseFromString(getGroovyVersionString());
} catch (Exception e) {
log.error("Unable to determine Groovy version. Is Groovy declared as a dependency?");
return null;
throw new RuntimeException("Unable to determine Groovy version. Is Groovy declared as a dependency?");
}
}

Expand Down Expand Up @@ -279,8 +278,7 @@ protected String getGroovyJar() {

return groovyJar;
} catch (ClassNotFoundException e) {
log.error("Unable to determine Groovy version. Is Groovy declared as a dependency?");
return null;
throw new RuntimeException("Unable to determine Groovy version. Is Groovy declared as a dependency?");
}
}

Expand Down

0 comments on commit 8f7f74e

Please sign in to comment.