From eebba26668588d5e644441b0dbcc04eb9f9f3eac Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 27 Sep 2019 16:25:13 +0200 Subject: fix error handling for failing fetch of eip-service.json in production flavor and minor refactorings --- .../main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/src/main/java/se/leap') diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java index 37adbe93..26f1691c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java @@ -750,6 +750,13 @@ public abstract class ProviderApiManagerBase { return result; } + protected Bundle setErrorResult(Bundle result, String stringJsonErrorMessage) { + String reasonToFail = pickErrorMessage(stringJsonErrorMessage); + result.putString(ERRORS, reasonToFail); + result.putBoolean(BROADCAST_RESULT_KEY, false); + return result; + } + Bundle setErrorResult(Bundle result, int errorMessageId, String errorId) { JSONObject errorJson = new JSONObject(); String errorMessage = getProviderFormattedString(resources, errorMessageId); -- cgit v1.2.3