LAME rethrow exception upon failure to show dialog; #PY-77200 Fixed

(cherry picked from commit 06df040104a66809754be69581328397ea8ee23e)

IJ-MR-148554

GitOrigin-RevId: 07a3da77d4daad821ce80a2a3c8552daa976aefb
This commit is contained in:
Aleksandr Sorotskii
2024-11-05 13:20:48 +01:00
committed by intellij-monorepo-bot
parent 4785cf4ca3
commit 1c20ef9d09

View File

@@ -37,7 +37,7 @@ class PackageManagerHolder : Disposable {
val cacheKey = (sdk.sdkAdditionalData as PythonSdkAdditionalData).uuid
return cache.computeIfAbsent(cacheKey) {
PythonPackageManagerProvider.EP_NAME.extensionList
PythonPackageManagerProvider.EP_NAME.extensionList
.firstNotNullOf { it.createPackageManagerForSdk(project, sdk) }
}
}
@@ -83,7 +83,9 @@ suspend fun <T> runPackagingOperationOrShowErrorDialog(
operation: suspend (() -> Result<T>),
): Result<T> {
try {
return operation.invoke()
val result = operation.invoke()
result.exceptionOrNull()?.let { throw it }
return result
}
catch (ex: PyExecutionException) {
val description = PyPackageManagementService.toErrorDescription(listOf(ex), sdk, packageName)