X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fasync%2FRetrieveTransactionsTask.java;h=8ac793663eb686ccc00d428db93b965ef8c4a2f8;hp=8b795ac1296ab703a74918a3a53393ba7418882f;hb=24eea00d6f49faeaf5bbbdad6178dc53ecfa08a5;hpb=349a5a3aca6dab475eada68d99d59d0dff9378b3 diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 8b795ac1..8ac79366 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -407,8 +407,7 @@ public class RetrieveTransactionsTask extends return retrieveAccountListForVersion(apiVersion); } } - private List retrieveAccountListAnyVersion() - throws HTTPException, ApiNotSupportedException { + private List retrieveAccountListAnyVersion() throws ApiNotSupportedException { for (API ver : API.allVersions) { try { return retrieveAccountListForVersion(ver); @@ -419,10 +418,9 @@ public class RetrieveTransactionsTask extends ver.getDescription())); } - throw new ApiNotSupportedException(); } - throw new RuntimeException("This should never be reached"); + throw new ApiNotSupportedException(); } private List retrieveAccountListForVersion(API version) throws IOException, HTTPException { @@ -483,16 +481,15 @@ public class RetrieveTransactionsTask extends try { return retrieveTransactionListForVersion(ver); } - catch (Exception | HTTPException e) { + catch (Exception e) { Logger.debug("json", String.format(Locale.US, "Error during account list retrieval using API %s", ver.getDescription())); } - throw new ApiNotSupportedException(); } - throw new RuntimeException("This should never be reached"); + throw new ApiNotSupportedException(); } private List retrieveTransactionListForVersion(API apiVersion) throws IOException, ParseException, HTTPException { @@ -590,8 +587,8 @@ public class RetrieveTransactionsTask extends } catch (HTTPException e) { e.printStackTrace(); - return new Result(String.format("HTTP error %d: %s", e.getResponseCode(), - e.getResponseMessage())); + return new Result( + String.format("HTTP error %d: %s", e.getResponseCode(), e.getMessage())); } catch (IOException e) { e.printStackTrace();