From 0a32ed60862330cd6cf62dafa494c92ea5e10a5c Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Fri, 29 Aug 2014 14:18:18 -0300 Subject: [PATCH] Replace catch-all exception handler in UpdateCheck --- app/src/processing/app/UpdateCheck.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/processing/app/UpdateCheck.java b/app/src/processing/app/UpdateCheck.java index 23e5b96be..e152b83ec 100644 --- a/app/src/processing/app/UpdateCheck.java +++ b/app/src/processing/app/UpdateCheck.java @@ -25,6 +25,7 @@ package processing.app; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.IOException; import java.net.URL; import java.util.Random; @@ -60,22 +61,16 @@ public class UpdateCheck { try { Thread.sleep(20 * 1000); // give the PDE time to get rolling updateCheck(); - } catch (Exception e) { + } catch (IOException e) { // this can safely be ignored, too many instances where no net // connection is available, so we'll leave it well alone. -// String msg = e.getMessage(); -// if (msg.contains("UnknownHostException")) { -// // nah, do nothing.. this happens when not connected to the net -// } else { -// e.printStackTrace(); -// } - } + } catch (InterruptedException e) {} } }, "Update Checker").start(); } - public void updateCheck() throws Exception { + public void updateCheck() throws IOException, InterruptedException { // generate a random id in case none exists yet Random r = new Random(); long id = r.nextLong(); @@ -178,7 +173,7 @@ public class UpdateCheck { } - protected int readInt(String filename) throws Exception { + protected int readInt(String filename) throws IOException { URL url = new URL(filename); InputStream stream = url.openStream(); InputStreamReader isr = new InputStreamReader(stream);