Olivier Patry
05/31/2025, 6:44 AMHttpCallValidator
? https://ktor.io/docs/client-response-validation.htmlOlivier Patry
05/31/2025, 6:47 AMexpectSuccess=true
& a custom validator, I get java.nio.channels.UnresolvedAddressException
, when no Internet connection.Olivier Patry
05/31/2025, 6:49 AMexpectSuccess=true
Austin
05/31/2025, 4:36 PMAleksei Tirman [JB]
06/10/2025, 11:32 AMMonitoring
phase of the HttpSendPipeline
and use proceed
to catch any exceptions thrown during the call. Here is an example:
val client = HttpClient(CIO) {}
client.sendPipeline.intercept(HttpSendPipeline.Monitoring) {
try {
proceed()
} catch (t: UnresolvedAddressException) {
println("Caught exception: $t")
throw t
}
}
client.get("<http://nonexistent1234.com>")