From: Eldar Abusalimov Date: Thu, 17 Nov 2016 11:51:46 +0000 (+0300) Subject: runners: Search for HyperlinkListener through the whole exception chain X-Git-Tag: dbe/171.1050~7 X-Git-Url: https://git.jetbrains.org/?p=idea%2Fcommunity.git;a=commitdiff_plain;h=88de702e9149828529b70e803fda3a0f2931acaa runners: Search for HyperlinkListener through the whole exception chain 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. --- 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 6bb69cfac545..f31feeb12049 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java +++ b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java @@ -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;