]> git.ktnx.net Git - mobile-ledger.git/commitdiff
Transaction saver task: add 30% probability of exception when simulating network...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 21:54:27 +0000 (23:54 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 21:54:27 +0000 (23:54 +0200)
app/src/main/java/net/ktnx/mobileledger/async/SendTransactionTask.java

index 2e8d9531931e7eef501dc0dedbe16cf76f207747..4c3bc477b8ddfeb43c82bd5e9268cb6f0105b232 100644 (file)
@@ -61,10 +61,10 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
     }
     private boolean sendOK() throws IOException {
 //        if (BuildConfig.DEBUG) {
-//        TODO: simulate random problems
-//
 //            try {
 //                Thread.sleep(1500);
+//                if (Math.random() > 0.3)
+//                    throw new RuntimeException("Simulated test exception");
 //            }
 //            catch (InterruptedException ex) {
 //                Logger.debug("network", ex.toString());