Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1415

Cant see line/column number in groovy runtime exceptions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-6
    • 1.0-RC-1
    • groovy-jdk
    • 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(); }

      }

          1. 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.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            spievak Rodrigo Spievak Cavalcanti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: