diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
commit | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch) | |
tree | fc0dcd722b6d445468dbe7dad13b4c11781b1cbe /platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java | |
parent | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff) | |
download | idea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz |
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
Diffstat (limited to 'platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java')
-rw-r--r-- | platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java index 0d15a272498c..b6c300c3f7e2 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java +++ b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java @@ -31,6 +31,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; +import com.intellij.openapi.ui.Messages; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.ui.content.Content; import com.intellij.util.ObjectUtils; @@ -65,18 +66,19 @@ public class ExecutionUtil { @NotNull final String toolWindowId, @NotNull String taskName, @NotNull ExecutionException e) { - if (e instanceof RunCanceledByUserException) return; + if (e instanceof RunCanceledByUserException) { + return; + } LOG.debug(e); String description = e.getMessage(); - HyperlinkListener listener = null; - if (description == null) { LOG.warn("Execution error without description", e); description = "Unknown error"; } + HyperlinkListener listener = null; if ((description.contains("87") || description.contains("111") || description.contains("206")) && e instanceof ProcessNotCreatedException && !PropertiesComponent.getInstance(project).isTrueValue("dynamic.classpath")) { @@ -110,7 +112,14 @@ public class ExecutionUtil { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - ToolWindowManager.getInstance(project).notifyByBalloon(toolWindowId, MessageType.ERROR, fullMessage, null, finalListener); + ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); + if (toolWindowManager.canShowNotification(toolWindowId)) { + //noinspection SSBasedInspection + toolWindowManager.notifyByBalloon(toolWindowId, MessageType.ERROR, fullMessage, null, finalListener); + } + else { + Messages.showErrorDialog(project, fullMessage, ""); + } NotificationListener notificationListener = ObjectUtils.tryCast(finalListener, NotificationListener.class); ourNotificationGroup.createNotification(title, finalDescription, NotificationType.ERROR, notificationListener).notify(project); } |