display groovyc version mismatch message more prominently (IDEA-96332)

This commit is contained in:
peter
2015-09-17 13:05:00 +02:00
parent 1259600d15
commit efa4711e2c
@@ -86,7 +86,11 @@ public class GroovyCompilerWrapper {
processException(e, INCOMPATIBLE_CLASS_CHANGE_ERROR);
}
catch (LinkageError e) {
processException(e, LINKAGE_ERROR);
if (e.getCause() instanceof GroovyRuntimeException) {
processException(e, getExceptionMessage((GroovyRuntimeException)e.getCause()));
} else {
processException(e, LINKAGE_ERROR);
}
}
finally {
addWarnings(unit.getErrorCollector());
@@ -207,6 +211,9 @@ public class GroovyCompilerWrapper {
final StringWriter writer = new StringWriter();
writer.append(prefix);
if (!prefix.endsWith("\n")) {
writer.append("\n\n");
}
//noinspection IOResourceOpenedButNotSafelyClosed
exception.printStackTrace(new PrintWriter(writer));
collector.add(new CompilerMessage(forStubs ? GroovyCompilerMessageCategories.INFORMATION : GroovyCompilerMessageCategories.ERROR, writer.toString(), null, -1, -1));