runners: Search for HyperlinkListener through the whole exception chain
authorEldar Abusalimov <eldar.abusalimov@jetbrains.com>
Thu, 17 Nov 2016 11:51:46 +0000 (14:51 +0300)
committerEldar Abusalimov <eldar.abusalimov@jetbrains.com>
Thu, 17 Nov 2016 12:37:37 +0000 (15:37 +0300)
ExecutionException often wraps some other one, so that the exact
exception implementing HyperlinkListener might be buried somewhere in
the exception chain fo the supplied one. This change allows a wrapped
exception still perform as a NotificationListener.

platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java

index 6bb69cfac545766716805cd175364eb5af933ed6..f31feeb120491434b98e7934a18ca6dfaa953f69 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.openapi.wm.ToolWindowManager;
 import com.intellij.ui.ColorUtil;
 import com.intellij.ui.LayeredIcon;
 import com.intellij.ui.content.Content;
+import com.intellij.util.ExceptionUtil;
 import com.intellij.util.ui.GraphicsUtil;
 import com.intellij.util.ui.JBUI;
 import com.intellij.util.ui.UIUtil;
@@ -110,8 +111,8 @@ public class ExecutionUtil {
       LOG.error(fullMessage, e);
     }
 
-    if (listener == null && e instanceof HyperlinkListener) {
-      listener = (HyperlinkListener)e;
+    if (listener == null) {
+      listener = ExceptionUtil.findCause(e, HyperlinkListener.class);
     }
 
     final HyperlinkListener finalListener = listener;