aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-08-26 10:06:03 -0300
committerTorsten Grote <t@grobox.de>2020-08-26 10:06:03 -0300
commited3f86481a71517e7bf6ffa46dc8d160b508ec38 (patch)
treeba91d81d539783297ac826a816bf6bb82765bc63
parentc8dbdaf02d200287cc1242f4826a6c9637398640 (diff)
downloadtaler-android-ed3f86481a71517e7bf6ffa46dc8d160b508ec38.tar.gz
taler-android-ed3f86481a71517e7bf6ffa46dc8d160b508ec38.tar.bz2
taler-android-ed3f86481a71517e7bf6ffa46dc8d160b508ec38.zip
[wallet] include JSON error details in user-facing error message
ugly, but helps with debugging
-rw-r--r--wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt7
1 files changed, 3 insertions, 4 deletions
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 4b39ff8..5826997 100644
--- a/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
+++ b/wallet/src/main/java/net/taler/wallet/backend/WalletResponse.kt
@@ -76,12 +76,11 @@ data class WalletErrorInfo(
append(" ")
append(message)
details?.let { details ->
+ append("\n\n")
details.optJSONObject("errorResponse")?.let { errorResponse ->
- append("\n\n")
- append(errorResponse.optString("code"))
- append(" ")
+ append(errorResponse.optString("code")).append(" ")
append(errorResponse.optString("hint"))
- }
+ } ?: append(details.toString(2))
}
}.toString()
}