Is there a recommendation to handle connection (or...
# ktor
n
Is there a recommendation to handle connection (or other) errors in a multiplatform-friendly way? For example when a WebSocket connection fails using the Java client engine, the following exception is thrown:
Copy code
java.net.ConnectException: null
	at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1045)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:224)
So the Java exception is thrown directly, there is no multiplatform Ktor wrapper exception. Does it mean that I should write error handling code for each platform and client engine? Thanks.
a
Unfortunately, Yes. There is a feature request to unify those exception under one type.
🙏 1
1
☹️ 1