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
Caught: java.lang.IllegalArgumentException: Problem with name:fred

I get no mention that the exception actually occurred in  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?
1 comment
Comment actions Permalink

That's Groovy script runner behavior ( As a
workaround, you could create a normal class with a main() method and run
it instead of the script.


Please sign in to leave a comment.