commit f426cb3760d54002a57725df31846d933ce1f35e
parent 1290c7fe549f39a7cf0faac20f6d6beaa714a603
Author: Torsten Grote <t@grobox.de>
Date: Wed, 18 Jan 2023 13:07:28 -0300
[pos] Fix merchant-lib test case
Diffstat:
1 file changed, 2 insertions(+), 5 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
@@ -17,9 +17,7 @@
package net.taler.merchantlib
import io.ktor.client.call.body
-import io.ktor.client.plugins.ClientRequestException
import io.ktor.client.plugins.ResponseException
-import io.ktor.client.plugins.ServerResponseException
import kotlinx.serialization.Serializable
class Response<out T> private constructor(
@@ -64,8 +62,7 @@ class Response<out T> private constructor(
}
private suspend fun getFailureString(failure: Failure): String = when (failure.exception) {
- is ClientRequestException -> getExceptionString(failure.exception)
- is ServerResponseException -> getExceptionString(failure.exception)
+ is ResponseException -> getExceptionString(failure.exception)
else -> failure.exception.toString()
}
@@ -85,6 +82,6 @@ class Response<out T> private constructor(
private class Error(
val code: Int?,
val hint: String?,
- val detail: String?,
+ val detail: String? = null,
)
}