https://kotlinlang.org logo
#ktor
Title
# ktor
h

hikkidev

08/24/2020, 8:40 AM
What has changed in feature
HttpCallValidator
in v1.4.0 ? DoubleReceiveException
Copy code
val client = HttpClient(OkHttp) {
        expectSuccess = false        
        
        install(HttpCallValidator) {
            validateResponse { response ->  throw RuntimeException("Response not valid") }
        }
}

@Throws(RuntimeException::class) 
suspend fun myBestRequest(): MyResponseObj = client.get {...}
Why can't I catch the error? In version 1.3.2 this worked.
Copy code
try {
        val response = myBestRequest()
        Result.success(response)
} catch (cause: Throwable) {
        Result.failure(cause)
}
c

cy

08/24/2020, 12:22 PM
cc @e5l
e

e5l

08/24/2020, 12:42 PM
Yep, it's the same. I'll take a look
5 Views