Implement JSR223 host in the main-kts jar

also improve diagnostics on configuration instantiation
This commit is contained in:
Ilya Chernikov
2019-07-11 17:33:43 +02:00
parent 0108a76e99
commit a13d452cd8
6 changed files with 108 additions and 2 deletions
@@ -124,6 +124,6 @@ private fun <T : Any> KClass<T>.createInstance(): T {
private fun <T : PropertiesCollection> scriptConfigInstance(kclass: KClass<out T>): T = try {
kclass.objectInstance ?: kclass.createInstance()
} catch (e: Throwable) {
throw IllegalArgumentException("$ILLEGAL_CONFIG_ANN_ARG: ${e.message}", e)
throw IllegalArgumentException("$ILLEGAL_CONFIG_ANN_ARG: ${e.message + if (e.cause != null) " (${e.cause})" else ""}", e)
}