]> git.ktnx.net Git - mobile-ledger.git/commitdiff
include errors sending transaction in debug output
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 2 Oct 2020 05:59:39 +0000 (08:59 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 2 Oct 2020 05:59:39 +0000 (08:59 +0300)
app/src/main/java/net/ktnx/mobileledger/async/SendTransactionTask.java

index 796da9310d5fcf8445b505b846785aa8e62207aa..8720dc0d5fb747b75494dde69941b849a104c7f9 100644 (file)
@@ -147,8 +147,19 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
                     case 201:
                         break;
                     case 400:
-                    case 405:
+                    case 405: {
+                        BufferedReader reader = new BufferedReader(new InputStreamReader(resp));
+                        String line;
+                        int count = 0;
+                        while (count <= 5) {
+                            line = reader.readLine();
+                            if (line == null)
+                                break;
+                            Logger.debug("network", line);
+                            count++;
+                        }
                         return false; // will cause a retry with the legacy method
+                    }
                     default:
                         BufferedReader reader = new BufferedReader(new InputStreamReader(resp));
                         String line = reader.readLine();