mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
Don't show errors on prepare cancel action (PY-63083)
+ correct exception handling (remove double wrap) + treat cancellation of sudo password request as cancel, not as ExitNonZero GitOrigin-RevId: baf43c9bb4652b0552899252b5638371715ee7a0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8abfa7d8d4
commit
6f69eaeb7a
@@ -128,6 +128,9 @@ abstract class DownloadableReleaseInstaller : ReleaseInstaller {
|
||||
catch (e: ProcessCanceledException) {
|
||||
throw CancelledPrepareException(e)
|
||||
}
|
||||
catch (e: PrepareException) {
|
||||
throw e
|
||||
}
|
||||
catch (e: Exception) {
|
||||
throw PrepareException(e)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class PkgReleaseInstaller : ResourceTypeReleaseInstaller(ResourceType.APPLE_SOFT
|
||||
*/
|
||||
class ExeReleaseInstaller : ResourceTypeReleaseInstaller(ResourceType.MICROSOFT_WINDOWS_EXECUTABLE) {
|
||||
override fun buildCommandLine(resource: Resource, path: Path): GeneralCommandLine {
|
||||
return GeneralCommandLine(path.absolutePathString(), "/quiet")
|
||||
return GeneralCommandLine(path.absolutePathString(), "/quiet", "InstallAllUsers=0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,12 @@ abstract class ResourceTypeReleaseInstaller(private val resourceType: ResourceTy
|
||||
throw ExecutionProcessException(commandLine, e)
|
||||
}
|
||||
processOutput.isCancelled.takeIf { it }?.let { throw CancelledProcessException(commandLine, processOutput) }
|
||||
processOutput.exitCode.takeIf { it != 0 }?.let { throw NonZeroExitCodeProcessException(commandLine, processOutput) }
|
||||
processOutput.exitCode.takeIf { it != 0 }?.let {
|
||||
if (processOutput.stderr.contains("User cancelled", ignoreCase = true)) {
|
||||
throw CancelledProcessException(commandLine, processOutput)
|
||||
}
|
||||
throw NonZeroExitCodeProcessException(commandLine, processOutput)
|
||||
}
|
||||
processOutput.isTimeout.takeIf { it }?.let { throw TimeoutProcessException(commandLine, processOutput) }
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ object PySdkToInstallManager {
|
||||
catch (ex: ReleaseInstallerException) {
|
||||
LOGGER.info(ex)
|
||||
PySdkToInstallCollector.logInstallerException(project, sdk.release, ex)
|
||||
showErrorNotification(sdk.release, ex)
|
||||
if (ex !is PrepareException) {
|
||||
showErrorNotification(sdk.release, ex)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user