From 234ad39fd6d8570e3a5fcf64a648896f385fabf3 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Wed, 29 Mar 2017 20:04:52 +0200 Subject: [PATCH] minor: improve daemon start failure diagnostic --- .../org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() } } }