Do not throw generic RestApiException to signal an internal server error

Just throw the ExecutionException which will be mapped to internal
server error too. This removes the specific exception message, but the
same information is available from the stacktrace which will be logged.
Since this was an internal server error, the message wasn't returned to
clients anyway.

Throwing RestApiExceptions to signal internal server errors is bad
since all RestApiExceptions are exempt from retries and auto-tracing.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ie2b167f72c3b659d32f2027c74dbcfb9a95dee04
diff --git a/src/main/java/com/googlesource/gerrit/plugins/manager/ListAvailablePlugins.java b/src/main/java/com/googlesource/gerrit/plugins/manager/ListAvailablePlugins.java
index ceeda09..e444c51 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/manager/ListAvailablePlugins.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/manager/ListAvailablePlugins.java
@@ -42,14 +42,9 @@
 
   @Override
   public Response<Map<String, PluginInfo>> apply(TopLevelResource resource)
-      throws RestApiException {
+      throws RestApiException, ExecutionException {
     Map<String, PluginInfo> output = Maps.newTreeMap();
-    List<PluginInfo> plugins;
-    try {
-      plugins = new ArrayList<>(pluginsCache.availablePlugins());
-    } catch (ExecutionException e) {
-      throw new RestApiException("Unable to load the list of available plugins", e);
-    }
+    List<PluginInfo> plugins = new ArrayList<>(pluginsCache.availablePlugins());
     Collections.sort(
         plugins,
         new Comparator<PluginInfo>() {