[Gradle] Restore special handling for OOM as a cause of RemoteException

Fixup to KT-59191
This commit is contained in:
Alexander.Likhachev
2023-06-09 17:43:32 +02:00
parent 441b22c0fd
commit 10285b32f1
@@ -245,12 +245,12 @@ internal class GradleKotlinCompilerWork @Inject constructor(
} }
bufferingMessageCollector.flush(messageCollector) bufferingMessageCollector.flush(messageCollector)
exitCodeFromProcessExitCode(log, res.get()) exitCodeFromProcessExitCode(log, res.get())
} catch (e: RemoteException) {
throw DaemonCrashedException(e)
} catch (e: Throwable) { } catch (e: Throwable) {
bufferingMessageCollector.flush(messageCollector) bufferingMessageCollector.flush(messageCollector)
if (e is OutOfMemoryError || e.hasOOMCause()) { if (e is OutOfMemoryError || e.hasOOMCause()) {
throw OOMErrorException(kotlinDaemonOOMHelperMessage) throw OOMErrorException(kotlinDaemonOOMHelperMessage)
} else if (e is RemoteException) {
throw DaemonCrashedException(e)
} else { } else {
throw e throw e
} }