Hey all. I'm seeking any form of documentation for...
# ktor
s
Hey all. I'm seeking any form of documentation for how best to handle various error situations that can occur related to Websockets. The standard seems to be just "try and catch literally everything that could possibly be thrown on any engine", or to map specific exceptions for specific engines, but I was hoping that these situations might already be abstracted out to a common engine-agnostic exception/result that I haven't found anywhere? These are the two situations I really care about, though other more specific errors would be nice to handle as well: 1.) the device cannot host a http server because it does not have any sort of ethernet interface 2.) the device has an ethernet interface, but there's no connection available I can't seem to find in the source code (after some significant digging) where an exception can actually be thrown in either of those cases, or if it's even thrown at all. Any help would be appreciated 🙂 The end goal is to provide the user with as accurate of an error response as possible for what exactly went wrong.
😞 1
👀 1
a
That's actually a great goal. Every time an application gives me "whoopsy, something went wrong" providing no useful information, it, um, gives me conniptions :) So I wasn't able to pass by and did some testing using virtualization to reproduce the cases (I only checked Netty, Jetty, and CIO). Sad to say, there were no actual exceptions that would've helped to identify a potential problem, the only useful thing I found was that little warning from Netty
[main] WARN i.netty.util.internal.MacAddressUtil - Failed to find a usable hardware address from the network interfaces; using random bytes
.
s
Unfortunately the only way I've been able to discover to do this (historically the case as well for using HttpClient with different engines) is to try to connect for each multiplatform target I'm targeting and discover what the exception is individually, which is less than ideal.
l
Would you share your findings so far?