Fix disappearing exceptions in GenerateProtoBuf.kt

Any exception caught during the generation (e.g. about an incompatible version)
is lost because of 'System.exit(0)' in 'finally'
This commit is contained in:
Alexander Udalov
2014-11-17 20:14:02 +03:00
parent 4e735878cf
commit 7d43f39c80
@@ -17,8 +17,6 @@
package org.jetbrains.jet.generators.protobuf
import com.intellij.execution.util.ExecUtil
import com.intellij.execution.process.BaseOSProcessHandler
import java.util.concurrent.ExecutorService
import java.io.File
// This file generates protobuf classes from formal description.
@@ -45,6 +43,10 @@ fun main(args: Array<String>) {
modifyAndExecProtoc(commonProto, "compiler/tests")
modifyAndExecProtoc(javaProto, "compiler/tests")
}
catch (e: Throwable) {
e.printStackTrace()
throw e
}
finally {
// Workaround for JVM hanging: IDEA's process handler creates thread pool
System.exit(0)