IJPL-166468 Don't rethrow CEs when notifying extension point listeners

GitOrigin-RevId: a9905ace620e0e2a339e01cb43993e894e62d33e
This commit is contained in:
Artem.Bukhonov
2024-11-07 22:38:27 +01:00
committed by intellij-monorepo-bot
parent acaa5c1e30
commit ff519b67c6

View File

@@ -17,6 +17,7 @@ import com.intellij.util.Java11Shim
import com.intellij.util.ThreeState import com.intellij.util.ThreeState
import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.job import kotlinx.coroutines.job
import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.ApiStatus
@@ -647,11 +648,11 @@ sealed class ExtensionPointImpl<T : Any>(@JvmField val name: String,
try { try {
(listener as ExtensionPointAdapter<T>).extensionListChanged() (listener as ExtensionPointAdapter<T>).extensionListChanged()
} }
catch (e: ProcessCanceledException) { catch (ce: CancellationException) {
throw e LOG.warn("Cancellation while notifying `${listener}`", ce)
} }
catch (e: Throwable) { catch (e: Throwable) {
LOG.error(e) LOG.error("Exception while notifying `$listener`", e)
} }
} }
else { else {
@@ -671,11 +672,11 @@ sealed class ExtensionPointImpl<T : Any>(@JvmField val name: String,
} }
} }
} }
catch (e: ProcessCanceledException) { catch (ce: CancellationException) {
throw e LOG.warn("Cancellation while notifying `$listener`", ce)
} }
catch (e: Throwable) { catch (e: Throwable) {
LOG.error(e) LOG.error("Exception while notifying `$listener`", e)
} }
} }
} }