Norbi
06/12/2024, 8:17 PMHttpClient.webSocketSession() fails with HTTP 401 error then a generic WebSocketException is throw:
WebSocketException: {"target":{},"type":"error","isTrusted":true}
The same exception is thrown when connection fails because the server is not running.
Is it possible to somehow differentiate among the various errors that can happen when connecting?
Thanks.Aleksei Tirman [JB]
06/13/2024, 7:51 AMNoTransformationFoundException when the server replies with 401 status code:
val client = HttpClient(Js) {
install(WebSockets)
}
try {
client.webSocketSession("<https://httpbin.org/status/401>")
} catch (e: Throwable) {
e.printStackTrace()
}