[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-android] branch master updated (8228901 -> 02e3fbb)
From: |
gnunet |
Subject: |
[taler-taler-android] branch master updated (8228901 -> 02e3fbb) |
Date: |
Tue, 04 Jul 2023 18:50:38 +0200 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a change to branch master
in repository taler-android.
from 8228901 [wallet] rename one more 'tip' to 'reward'
new 42d2953 [wallet] Show errorResponse hint in error response when
available.
new 02e3fbb [wallet] add TODO for error on init
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../main/java/net/taler/wallet/backend/WalletBackendApi.kt | 1 +
.../main/java/net/taler/wallet/backend/WalletResponse.kt | 14 ++++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
index 06b8cee..c894cf6 100644
--- a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
+++ b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
@@ -53,6 +53,7 @@ class WalletBackendApi(
}.onSuccess { response ->
versionReceiver.onVersionReceived(response.versionInfo)
}.onError { error ->
+ // TODO expose this to the UI as it can happen when using an older
DB version
error("Error on init message: $error")
}
}
diff --git a/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
b/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
index 37bf91e..8ef135f 100644
--- a/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
+++ b/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
@@ -29,6 +29,7 @@ import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.buildJsonObject
+import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
@Serializable
@@ -75,8 +76,17 @@ data class TalerErrorInfo(
val userFacingMsg: String
get() {
return StringBuilder().apply {
- hint?.let { append(it) }
- message?.let { append(" ").append(it) }
+ // If there's a hint in errorResponse, use it.
+ extra["errorResponse"]
+ ?.jsonObject
+ ?.get("hint")
+ ?.let {
+ append(it.jsonPrimitive.content)
+ } ?: {
+ // Otherwise, use the standard ones.
+ hint?.let { append(it) }
+ message?.let { append(" ").append(it) }
+ }
}.toString()
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-android] branch master updated (8228901 -> 02e3fbb),
gnunet <=