User: joe Date: 16 Sep 23 13:08 Revision: b0c7c8c3a799cc4bdd996572333a4b1f5151248c Summary: Merge branch '2022.3' into 2023.1 # Conflicts: # src/main/kotlin/creator/step/AbstractLatentStep.kt TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=8730&personal=false Index: src/main/kotlin/creator/step/AbstractLatentStep.kt =================================================================== --- src/main/kotlin/creator/step/AbstractLatentStep.kt (revision 7d4ba10eed830461b853e2f9f4cf63c8bd2f5643) +++ src/main/kotlin/creator/step/AbstractLatentStep.kt (revision b0c7c8c3a799cc4bdd996572333a4b1f5151248c) @@ -84,12 +84,12 @@ return@launch } - val result = asyncIO { + val (result: T?, errorMessage: String?) = asyncIO { try { - computeData() + computeData() to null } catch (e: Throwable) { - LOGGER.error(e) - null + LOGGER.warn("computeData failed", e) + null to e.message } }.await() @@ -105,17 +105,11 @@ if (result == null) { placeholder.component = panel { row { - val label = label(MCDevBundle("creator.ui.generic_validation_failure.message", description)) + val labelValidationText = + MCDevBundle("creator.ui.generic_validation_failure.message", description, errorMessage) + val label = label(labelValidationText) .validationRequestor(WHEN_GRAPH_PROPAGATION_FINISHED(propertyGraph)) - .validation( - DialogValidation { - val labelValidationText = MCDevBundle( - "creator.ui.generic_validation_failure.message", - description - ) - ValidationInfo(labelValidationText) - } - ) + .validation(DialogValidation { ValidationInfo(labelValidationText) }) label.component.foreground = JBColor.RED } } Index: src/main/kotlin/util/utils.kt =================================================================== --- src/main/kotlin/util/utils.kt (revision 7d4ba10eed830461b853e2f9f4cf63c8bd2f5643) +++ src/main/kotlin/util/utils.kt (revision b0c7c8c3a799cc4bdd996572333a4b1f5151248c) @@ -368,13 +368,15 @@ inline fun runCatchingKtIdeaExceptions(action: () -> T): T? = try { action() } catch (e: Exception) { - if (e.javaClass.name == "org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException") { + when (e.javaClass.name) { + "org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException", + "org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments" -> { - loggerForTopLevel().info("Caught Kotlin plugin exception", e) - null + loggerForTopLevel().info("Caught Kotlin plugin exception", e) + null - } else { - throw e - } + } + else -> throw e -} + } +} fun withSuppressed(original: T?, other: T): T = original?.apply { addSuppressed(other) } ?: other