Kapt: Remove artificial KaptError exception on errors from annotation processor (KT-21262)

This commit is contained in:
Yan Zhulanow
2017-11-16 19:18:57 +09:00
parent 0a0de8da29
commit 3d1ca61f9f
5 changed files with 34 additions and 14 deletions
@@ -22,6 +22,7 @@ import kotlin.collections.ArraysKt;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.analyzer.AnalysisResult;
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
import org.jetbrains.kotlin.cli.common.messages.GroupingMessageCollector;
import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
@@ -127,6 +128,9 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
}
return exitCode;
}
catch (AnalysisResult.CompilationErrorException e) {
return COMPILATION_ERROR;
}
catch (Throwable t) {
MessageCollectorUtil.reportException(groupingCollector, t);
return INTERNAL_ERROR;