From f98ebe53c0d27faa6a6f772a72aef82a4ab428d1 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 9 Feb 2012 19:47:44 +0100 Subject: [PATCH] better diagnostics --- .../compiler/rt/GroovyCompilerWrapper.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java b/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java index 4d32ba25904f..a9ce6893f049 100644 --- a/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java +++ b/plugins/groovy/rt/src/org/jetbrains/groovy/compiler/rt/GroovyCompilerWrapper.java @@ -161,14 +161,18 @@ public class GroovyCompilerWrapper { private static void processException(Exception exception, List collector, boolean forStubs) { if (exception instanceof GroovyRuntimeException) { addErrorMessage((GroovyRuntimeException) exception, collector); - } else if (forStubs) { - addMessageWithoutLocation(collector, "Groovyc stub generation failed: " + exception.getMessage(), false); - } else { - final StringWriter writer = new StringWriter(); - //noinspection IOResourceOpenedButNotSafelyClosed - exception.printStackTrace(new PrintWriter(writer)); - addMessageWithoutLocation(collector, writer.toString(), true); + return; } + + if (forStubs) { + collector.add(new CompilerMessage(CompilerMessage.INFORMATION, + "Groovyc stub generation failed", null, -1, -1)); + } + + final StringWriter writer = new StringWriter(); + //noinspection IOResourceOpenedButNotSafelyClosed + exception.printStackTrace(new PrintWriter(writer)); + collector.add(new CompilerMessage(forStubs ? CompilerMessage.INFORMATION : CompilerMessage.ERROR, writer.toString(), null, -1, -1)); } private static void addMessageWithoutLocation(List collector, String message, boolean error) {