Make exception more user-friendly

Accompany registration of non-compatible compiler plugin with readable error

#KTIJ-21077 Fixed
This commit is contained in:
Aleksei.Cherepanov
2022-08-29 14:26:08 +02:00
committed by Space
parent 036f9affd8
commit 0d1b748cd5
@@ -51,6 +51,7 @@ import org.jetbrains.kotlin.cli.common.config.kotlinSourceRoots
import org.jetbrains.kotlin.cli.common.extensions.ScriptEvaluationExtension
import org.jetbrains.kotlin.cli.common.extensions.ShellExtension
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.STRONG_WARNING
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.jarfs.FastJarFileSystem
@@ -656,7 +657,7 @@ class KotlinCoreEnvironment private constructor(
if (registrar.javaClass.simpleName == "ScriptingCompilerConfigurationComponentRegistrar") {
messageCollector?.report(STRONG_WARNING, "Default scripting plugin is disabled: $message")
} else {
throw IllegalStateException(message, e)
messageCollector?.report(ERROR, message)
}
}
}