WarDistribution: Don't bail out when scanning corrupted jar file

Instead of bailing out when corrupted jar file is scanned during gerrit
init or startup step, log error message and proceed with other plugins.

Change-Id: I91a9beb24c52750d09f81a1256166d681ec83b5e
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/WarDistribution.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/WarDistribution.java
index 1b4946a..37ce995 100644
--- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/WarDistribution.java
+++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/WarDistribution.java
@@ -28,12 +28,15 @@
 import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Singleton
 public class WarDistribution implements PluginsDistribution {
+  private static final Logger log = LoggerFactory.getLogger(WarDistribution.class);
 
   @Override
-  public void foreach(Processor processor) throws FileNotFoundException, IOException {
+  public void foreach(Processor processor) throws IOException {
     File myWar = GerritLauncher.getDistributionArchive();
     if (myWar.isFile()) {
       try (ZipFile zf = new ZipFile(myWar)) {
@@ -49,6 +52,9 @@
             String pluginName = pluginJarName.substring(0, pluginJarName.length() - JAR.length());
             try (InputStream in = zf.getInputStream(ze)) {
               processor.process(pluginName, in);
+            } catch (IOException ioe) {
+              log.error(
+                  String.format("Error opening plugin %s: %s", ze.getName(), ioe.getMessage()));
             }
           }
         }