[IC] Fix RecoverableCompilationTransaction wasn't throwing an exception properly
#KT-56052 In Progress
This commit is contained in:
committed by
Space Team
parent
83ea1ca3cf
commit
8825cf7bf6
@@ -240,17 +240,21 @@ class RecoverableCompilationTransaction(
|
|||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
val mainException = closeCachesManager()
|
val mainException = closeCachesManager()
|
||||||
|
val exceptionToThrow = runCatching {
|
||||||
try {
|
|
||||||
if (isSuccessful) {
|
if (isSuccessful) {
|
||||||
cleanupStash()
|
cleanupStash()
|
||||||
} else {
|
} else {
|
||||||
revertChanges()
|
revertChanges()
|
||||||
cleanupStash()
|
cleanupStash()
|
||||||
}
|
}
|
||||||
} catch (t: Throwable) {
|
}.exceptionOrNull().run {
|
||||||
mainException?.addSuppressed(t)
|
if (this != null) {
|
||||||
throw mainException ?: t
|
mainException?.addSuppressed(this)
|
||||||
|
}
|
||||||
|
mainException ?: this
|
||||||
|
}
|
||||||
|
if (exceptionToThrow != null) {
|
||||||
|
throw exceptionToThrow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user