intellij-openshift-connector
intellij-openshift-connector copied to clipboard
Errors that occurr when launching actions should be displayed using notifications, not dialogs
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))