From: Damyan Ivanov Date: Tue, 20 Apr 2021 19:44:12 +0000 (+0300) Subject: interpret only json-parsing exceptions as API mismatch X-Git-Tag: v0.18.0~72 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=673119deb3dfcb78b6f6259213c8db34b7aa36c9;p=mobile-ledger.git interpret only json-parsing exceptions as API mismatch all others, like no Internet, bad host name etc should be reported as usual --- 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 8ac79366..88c3ee83 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -25,6 +25,7 @@ import android.os.OperationCanceledException; import androidx.annotation.NonNull; import androidx.room.Transaction; +import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.RuntimeJsonMappingException; import net.ktnx.mobileledger.App; @@ -407,15 +408,16 @@ public class RetrieveTransactionsTask extends return retrieveAccountListForVersion(apiVersion); } } - private List retrieveAccountListAnyVersion() throws ApiNotSupportedException { + private List retrieveAccountListAnyVersion() + throws ApiNotSupportedException, IOException, HTTPException { for (API ver : API.allVersions) { try { return retrieveAccountListForVersion(ver); } - catch (Exception e) { + catch (JsonParseException | RuntimeJsonMappingException e) { Logger.debug("json", String.format(Locale.US, "Error during account list retrieval using API %s", - ver.getDescription())); + ver.getDescription()), e); } }