mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
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
This commit is contained in:
parent
eb2d89301f
commit
7b9eb7af63
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue