From 62f3406d1f501b291309e534b53b02ecb46298c3 Mon Sep 17 00:00:00 2001 From: Robert Kolner Date: Wed, 21 Sep 2011 18:19:48 +0200 Subject: [PATCH] Removed unnecessary try-catch block from openHttpConnection. --- .../studentersamfundet/app/FeedFetcher.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/com/studentersamfundet/app/FeedFetcher.java b/src/com/studentersamfundet/app/FeedFetcher.java index 2ab6bf1..41da7f4 100644 --- a/src/com/studentersamfundet/app/FeedFetcher.java +++ b/src/com/studentersamfundet/app/FeedFetcher.java @@ -31,20 +31,16 @@ public class FeedFetcher { if (!(con instanceof HttpURLConnection)) throw new IOException("Not an HTTP connection!"); - try { - HttpURLConnection httpCon = (HttpURLConnection) con; - httpCon.setAllowUserInteraction(false); - httpCon.setInstanceFollowRedirects(true); - httpCon.setRequestMethod("GET"); - httpCon.connect(); - - response = httpCon.getResponseCode(); - - if (response == HttpURLConnection.HTTP_OK) - in = httpCon.getInputStream(); - } catch (Exception e) { - throw new IOException("Error connecting."); - } + HttpURLConnection httpCon = (HttpURLConnection) con; + httpCon.setAllowUserInteraction(false); + httpCon.setInstanceFollowRedirects(true); + httpCon.setRequestMethod("GET"); + httpCon.connect(); + + response = httpCon.getResponseCode(); + + if (response == HttpURLConnection.HTTP_OK) + in = httpCon.getInputStream(); return in; }