intellij-openshift-connector icon indicating copy to clipboard operation
intellij-openshift-connector copied to clipboard

Errors that occurr when launching actions should be displayed using notifications, not dialogs

Open adietish opened this issue 2 years ago • 0 comments

ex. CreateProjectAction#doActionPerformed

        } catch (IOException | CompletionException e) {
          ...
          UIHelper.executeInUI(() -> Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Create Project"));
        }

Since no user action is required, a dialog is not suggested, a sticky balloon (com.redhat.devtools.intellij.common.compat.NotificationGroupFactory) should be used. The benefit for the user is that he does not have to close the dialog, he can simply read it and keep going.

See how it's used in intellij-kubernetes: https://github.com/redhat-developer/intellij-kubernetes/blob/main/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/actions/DeleteResourceAction.kt#L50

Notification().error("Could not delete resource(s)", toMessage(resources, 30))

adietish avatar Oct 31 '23 10:10 adietish