Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
1.0-JSR-6
-
None
-
Windows XP SP2, Sun JDK 1.5.06, Athlon 64 / 1GB RAM.
Description
I´m embedding groovy inside a cms solution, but when a script has errors like missing variable, it does not show the error location in script. Here is the code and the result (stack trace).
import groovy.lang.GroovyShell;
public class GroovyTest {
public static void main(String args[]) throws Exception
{ GroovyShell gs = new GroovyShell(); gs.parse("println 'a';\n println b;\n println c;").run(); }}
-
-
- Result ###
-
a
Exception in thread "main" groovy.lang.MissingPropertyException: No such property: b for class: Script1
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:729)
at groovy.lang.GroovyObjectSupport.getProperty(GroovyObjectSupport.java:65)
at groovy.lang.Script.getProperty(Script.java:84)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getGroovyObjectProperty(ScriptBytecodeAdapter.java:365)
at Script1.run(Script1.groovy:2)
at GroovyTest.main(GroovyTest.java:8)
Continuing, fixing the incorrect script is very dificult because of inexisting line/column error information.