From 93a9a26467adf7fde7125c6018b77cdda3e9a96f Mon Sep 17 00:00:00 2001 From: Peter Kriens Date: Mon, 24 Sep 2018 11:28:32 +0200 Subject: [PATCH] [repositoriesview] Logging the target exception Chasing an exception in refreshing plugins. We only show the target exception and no trace. This adds a trace into the log. Signed-off-by: Peter Kriens --- .../src/bndtools/views/repository/RepositoriesView.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bndtools.core/src/bndtools/views/repository/RepositoriesView.java b/bndtools.core/src/bndtools/views/repository/RepositoriesView.java index 52c3debb1..ba5d8f270 100644 --- a/bndtools.core/src/bndtools/views/repository/RepositoriesView.java +++ b/bndtools.core/src/bndtools/views/repository/RepositoriesView.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URI; import java.net.URL; @@ -614,7 +615,13 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { refreshAction.setEnabled(false); Central.refreshPlugins(); } catch (Exception e) { - return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "Failed to refresh plugins", e); + Throwable t = e; + while (t instanceof InvocationTargetException) + t = ((InvocationTargetException) e).getTargetException(); + + logger.logError("Unexpected error in refreshing plugns", t); + + return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "Failed to refresh plugins", t); } finally { refreshAction.setEnabled(true); }