Skip to content

Commit

Permalink
[repositoriesview] Logging the target exception
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pkriens committed Sep 24, 2018
1 parent 2c69a52 commit 93a9a26
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 93a9a26

Please sign in to comment.