diff --git a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt index 00c5eb1775f..48f0f67d74e 100644 --- a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt +++ b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt @@ -447,7 +447,7 @@ object KotlinCompilerClient { if (daemonOptions.runFilesPath.isNotEmpty()) { val succeeded = isEchoRead.tryAcquire(daemonStartupTimeout, TimeUnit.MILLISECONDS) if (!isProcessAlive(daemon)) - throw Exception("Daemon terminated unexpectedly") + throw Exception("Daemon terminated unexpectedly with error code: ${daemon.exitValue()}") if (!succeeded) throw Exception("Unable to get response from daemon in $daemonStartupTimeout ms") } @@ -461,6 +461,7 @@ object KotlinCompilerClient { // TODO: find better method to stop the thread, but seems it will require asynchronous consuming of the stream stdoutThread.stop() } + reportingTargets.out?.flush() } } }