From 673119deb3dfcb78b6f6259213c8db34b7aa36c9 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 20 Apr 2021 22:44:12 +0300 Subject: [PATCH] interpret only json-parsing exceptions as API mismatch all others, like no Internet, bad host name etc should be reported as usual --- .../ktnx/mobileledger/async/RetrieveTransactionsTask.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } } -- 2.39.5