I keep forgetting that you can't use the normal IOException constructor in old Android

git-svn-id: https://zxing.googlecode.com/svn/trunk@2552 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2013-01-15 13:10:11 +00:00
parent b89f3d5e35
commit 65be855649

View file

@ -190,26 +190,26 @@ public final class HttpHelper {
} 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); 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); 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); throw new IOException(se.toString());
} 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); 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); Log.w(TAG, "Bad URI? " + uri);
throw new IOException(npe); throw new IOException(npe.toString());
} }
} }