mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 11:47:26 -08:00
Catch odd IAE from HTTP connection -- bad URI?
git-svn-id: https://zxing.googlecode.com/svn/trunk@2437 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
8596fcba7c
commit
65e3d10b52
|
@ -103,7 +103,12 @@ public final class HttpHelper {
|
|||
connection.connect();
|
||||
} 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);
|
||||
} 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);
|
||||
}
|
||||
if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
|
||||
throw new IOException("Bad HTTP response: " + connection.getResponseCode());
|
||||
|
@ -169,7 +174,12 @@ public final class HttpHelper {
|
|||
connection.connect();
|
||||
} 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);
|
||||
} 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);
|
||||
}
|
||||
switch (connection.getResponseCode()) {
|
||||
case HttpURLConnection.HTTP_MULT_CHOICE:
|
||||
|
|
Loading…
Reference in a new issue