Bug 769671 - Don't use IOException(Throwable cause), since it is only available in API level >= 9. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Wed, 22 Aug 2012 09:49:28 -0700
changeset 105074 91cba558c70c3a08699ba5c4958239f2c77f6d33
parent 105073 0f34437ce5332e039d7ecb37ee9f8b754971e0f0
child 105075 fcb1cb11935f91aa0778837f98235123e5422ca0
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersrnewman
bugs769671
milestone17.0a1
Bug 769671 - Don't use IOException(Throwable cause), since it is only available in API level >= 9. r=rnewman
mobile/android/base/sync/net/BaseResource.java
--- a/mobile/android/base/sync/net/BaseResource.java
+++ b/mobile/android/base/sync/net/BaseResource.java
@@ -262,17 +262,20 @@ public class BaseResource implements Res
       } else {
         retryRequest();
       }
       return;
     } catch (Exception e) {
       // Bug 740731: Don't let an exception fall through. Wrapping isn't
       // optimal, but often the exception is treated as an Exception anyway.
       if (!retryOnFailedRequest) {
-        delegate.handleHttpIOException(new IOException(e));
+        // Bug 769671: IOException(Throwable cause) was added only in API level 9.
+        final IOException ex = new IOException();
+        ex.initCause(e);
+        delegate.handleHttpIOException(ex);
       } else {
         retryRequest();
       }
       return;
     }
 
     // Don't retry if the observer or delegate throws!
     HttpResponseObserver observer = getHttpResponseObserver();