From 7b9eb7af6390720149caf983aaf4f9d5d15caa0a Mon Sep 17 00:00:00 2001 From: srowen Date: Wed, 24 Oct 2012 17:26:14 +0000 Subject: [PATCH] Strangely, Exception constructors that take a chained Exception didn't exist before API level 9 (though have always been in Java). Don't use them to avoid NoSuchMethodError on Froyo and earlier. git-svn-id: https://zxing.googlecode.com/svn/trunk@2481 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../com/google/zxing/client/android/HttpHelper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/src/com/google/zxing/client/android/HttpHelper.java b/android/src/com/google/zxing/client/android/HttpHelper.java index 047608e89..ea8d99315 100644 --- a/android/src/com/google/zxing/client/android/HttpHelper.java +++ b/android/src/com/google/zxing/client/android/HttpHelper.java @@ -104,11 +104,11 @@ public final class HttpHelper { } catch (NullPointerException npe) { // this is an Android bug: http://code.google.com/p/android/issues/detail?id=16895 Log.w(TAG, "Bad URI? " + uri); - throw new IOException(npe); + throw new IOException(npe.toString()); } catch (IllegalArgumentException iae) { // Also seen this in the wild, not sure what to make of it. Probably a bad URL Log.w(TAG, "Bad URI? " + uri); - throw new IOException(iae); + throw new IOException(iae.toString()); } int responseCode; try { @@ -116,7 +116,7 @@ public final class HttpHelper { } catch (NullPointerException npe) { // this is maybe this Android bug: http://code.google.com/p/android/issues/detail?id=15554 Log.w(TAG, "Bad URI? " + uri); - throw new IOException(npe); + throw new IOException(npe.toString()); } if (responseCode != HttpURLConnection.HTTP_OK) { throw new IOException("Bad HTTP response: " + responseCode); @@ -185,11 +185,11 @@ public final class HttpHelper { } catch (NullPointerException npe) { // this is an Android bug: http://code.google.com/p/android/issues/detail?id=16895 Log.w(TAG, "Bad URI? " + uri); - throw new IOException(npe); + throw new IOException(npe.toString()); } catch (IllegalArgumentException iae) { // Also seen this in the wild, not sure what to make of it. Probably a bad URL Log.w(TAG, "Bad URI? " + uri); - throw new IOException(iae); + throw new IOException(iae.toString()); } int responseCode; try { @@ -197,7 +197,7 @@ public final class HttpHelper { } catch (NullPointerException npe) { // this is maybe this Android bug: http://code.google.com/p/android/issues/detail?id=15554 Log.w(TAG, "Bad URI? " + uri); - throw new IOException(npe); + throw new IOException(npe.toString()); } switch (responseCode) { case HttpURLConnection.HTTP_MULT_CHOICE: