mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Swallow another weird Android HTTP lib exception; use the proper IOException constructor now that we're on API 9+; don't log unuseful messages about obscure errors
git-svn-id: https://zxing.googlecode.com/svn/trunk@2898 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
6d7a77d73f
commit
21500405d5
|
@ -200,7 +200,7 @@ public final class HttpHelper {
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
// Another strange bug in Android?
|
// Another strange bug in Android?
|
||||||
Log.w(TAG, "Bad URI? " + url);
|
Log.w(TAG, "Bad URI? " + url);
|
||||||
throw new IOException(npe.toString());
|
throw new IOException(npe);
|
||||||
}
|
}
|
||||||
if (!(conn instanceof HttpURLConnection)) {
|
if (!(conn instanceof HttpURLConnection)) {
|
||||||
throw new IOException();
|
throw new IOException();
|
||||||
|
@ -213,31 +213,30 @@ public final class HttpHelper {
|
||||||
connection.connect();
|
connection.connect();
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
// this is an Android bug: http://code.google.com/p/android/issues/detail?id=16895
|
// 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) {
|
} catch (IllegalArgumentException iae) {
|
||||||
// Also seen this in the wild, not sure what to make of it. Probably a bad URL
|
// 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());
|
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
// due to bad VPN settings?
|
// due to bad VPN settings?
|
||||||
Log.w(TAG, "Restricted URI? " + uri);
|
Log.w(TAG, "Restricted URI? " + uri);
|
||||||
throw new IOException(se.toString());
|
throw new IOException(se);
|
||||||
} catch (IndexOutOfBoundsException ioobe) {
|
} catch (IndexOutOfBoundsException ioobe) {
|
||||||
// Another Android problem? https://groups.google.com/forum/?fromgroups#!topic/google-admob-ads-sdk/U-WfmYa9or0
|
// Another Android problem? https://groups.google.com/forum/?fromgroups#!topic/google-admob-ads-sdk/U-WfmYa9or0
|
||||||
Log.w(TAG, "Bad URI? " + uri);
|
throw new IOException(ioobe);
|
||||||
throw new IOException(ioobe.toString());
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return connection.getResponseCode();
|
return connection.getResponseCode();
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
// this is maybe this Android bug: http://code.google.com/p/android/issues/detail?id=15554
|
// 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());
|
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
// Again seen this in the wild for bad header fields in the server response! or bad reads
|
// Again seen this in the wild for bad header fields in the server response! or bad reads
|
||||||
Log.w(TAG, "Bad server status? " + uri);
|
Log.w(TAG, "Bad server status? " + uri);
|
||||||
throw new IOException(iae.toString());
|
throw new IOException(iae);
|
||||||
|
} catch (StringIndexOutOfBoundsException sioobe) {
|
||||||
|
// Another Android bug: https://code.google.com/p/android/issues/detail?id=18856
|
||||||
|
throw new IOException(sioobe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ final class AmazonInfoRetriever extends SupplementalInfoRetriever {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (XmlPullParserException xppe) {
|
} catch (XmlPullParserException xppe) {
|
||||||
throw new IOException(xppe.toString());
|
throw new IOException(xppe);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error || detailPageURL == null) {
|
if (error || detailPageURL == null) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ final class BookResultInfoRetriever extends SupplementalInfoRetriever {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new IOException(e.toString());
|
throw new IOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<String> newTexts = new ArrayList<String>();
|
Collection<String> newTexts = new ArrayList<String>();
|
||||||
|
|
Loading…
Reference in a new issue