diff options
author | cyBerta <cyberta@riseup.net> | 2019-09-27 16:25:13 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-09-27 16:25:13 +0200 |
commit | eebba26668588d5e644441b0dbcc04eb9f9f3eac (patch) | |
tree | 9a400d21a6ae0b8c3aa029acf86263d3b94cff3f /app/src/main/java | |
parent | 91877ac8ed64927d14c0762cd4402e5ed736fab9 (diff) |
fix error handling for failing fetch of eip-service.json in production flavor and minor refactorings
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java | 7 |
1 files changed, 7 insertions, 0 deletions
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); |