Use the same way to check for ProcessCanceledException everywhere

This commit is contained in:
Valentin Kipyatkov
2017-06-01 17:14:38 +03:00
parent eb4f322c77
commit 61d9a6b9cd
6 changed files with 13 additions and 90 deletions
@@ -9,6 +9,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="daemon-common" scope="PROVIDED" />
<orderEntry type="module" module-name="util" scope="PROVIDED" />
<orderEntry type="module" module-name="util.runtime" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="native-platform-uberjar" level="project" />
<orderEntry type="module" module-name="cli-common" scope="PROVIDED" />
<orderEntry type="module" module-name="descriptors" scope="PROVIDED" />
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompil
import org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto
import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.utils.isProcessCanceledException
import java.rmi.server.UnicastRemoteObject
import kotlin.reflect.full.allSuperclasses
@@ -87,7 +88,7 @@ open class CompilerCallbackServicesFacadeServer(
catch (e: Exception) {
// avoid passing exceptions that may have different serialVersionUID on across rmi border
// removing dependency from openapi (this is obsolete part anyway, and will be removed soon)
if ((e::class.allSuperclasses + e::class).any { it.qualifiedName == "com.intellij.openapi.progress.ProcessCanceledException" })
if (e.isProcessCanceledException())
throw RmiFriendlyCompilationCanceledException()
else throw e
}