Description
Given the following script:
gcl = new GroovyClassLoader()
try {
def clazz = gcl.parseClass(new File("Test.groovy"))
}
catch(RuntimeException e) {
println e.message
e.printStackTrace(System.out)
}
And the following class:
class TestClass {
Test(SomeClass someClass)
}
The exception that is thrown contains no information about the cause of the problem:
startup failed,
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:326)
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:173)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:143)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:155)
at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:382)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:87)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:279)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:184)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:833)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:480)
Even if you try iterative over ErrorCollector there is nothing to tell you that the reason the exception was thrown is that SomeClass.class does not exist