]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/async/SendTransactionTask.java
Transaction saver task: add 30% probability of exception when simulating network...
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / async / SendTransactionTask.java
index 7a2b973149f5e3ab31ecd0d532bc5414e5fe0116..4c3bc477b8ddfeb43c82bd5e9268cb6f0105b232 100644 (file)
@@ -60,6 +60,19 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
         mProfile = profile;
     }
     private boolean sendOK() throws IOException {
+//        if (BuildConfig.DEBUG) {
+//            try {
+//                Thread.sleep(1500);
+//                if (Math.random() > 0.3)
+//                    throw new RuntimeException("Simulated test exception");
+//            }
+//            catch (InterruptedException ex) {
+//                Logger.debug("network", ex.toString());
+//            }
+//
+//            return true;
+//        }
+
         HttpURLConnection http = NetworkUtil.prepareConnection(mProfile, "add");
         http.setRequestMethod("PUT");
         http.setRequestProperty("Content-Type", "application/json");