Groovy script swallowing Java exceptions
I'm running a Groovy script as follows:
"
Foo foo = new Foo("fred")
"
where Foo is a java class defined as:
"
public class Foo {
public Foo(String name){
throw new IllegalArgumentException("Problem with name:"+name);
}
}
"
When running this Groovy script, I get
I get no mention that the exception actually occurred in Foo.java. I have "Enable debug stacktrace" enabled.
Also there is no hyperlink enabled to click on the exception to take me to the source code. Is that functionality supported in Groovy?
When running this Groovy script, I get
Caught: java.lang.IllegalArgumentException: Problem with name:fred
at Common.run(Common.groovy:4)
at Common.run(Common.groovy:4)
I get no mention that the exception actually occurred in Foo.java. I have "Enable debug stacktrace" enabled.
Also there is no hyperlink enabled to click on the exception to take me to the source code. Is that functionality supported in Groovy?
Please sign in to leave a comment.
That's Groovy script runner behavior (GroovyMain.java:328). As a
workaround, you could create a normal class with a main() method and run
it instead of the script.