commit 3383aa3e7cb39a53203a8d0ad372097060e91d69
parent 438c413136ff49533d9af5f9889dcd0c8b7d9e58
Author: Torsten Grote <t@grobox.de>
Date: Tue, 17 Jan 2023 14:45:11 -0300
[pos] include error detail in error string
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/merchant-lib/src/main/java/net/taler/merchantlib/Response.kt b/merchant-lib/src/main/java/net/taler/merchantlib/Response.kt
@@ -73,7 +73,7 @@ class Response<out T> private constructor(
val response = e.response
return try {
val error: Error = response.body()
- "Error ${error.code}: ${error.hint}"
+ "Error ${error.code} (${response.status.value}): ${error.hint} ${error.detail}"
} catch (ex: Exception) {
"Status code: ${response.status.value}"
}
@@ -84,6 +84,7 @@ class Response<out T> private constructor(
@Serializable
private class Error(
val code: Int?,
- val hint: String?
+ val hint: String?,
+ val detail: String?,
)
}