Websocket error handling
Posted: 01 Feb 2018 10:10
From what I can read out of the developer's manual and my own experiments, the websocket implementation seems a bit lacking.
In my application, I need to differentiate between different kinds of errors – timeout, no route to host and connection refused, specifically. The event passed to the onerror function on error has only one element, "data", which contains only the string "Connection error" on all of the errors above.
I also need to adjust the timeout parameter. I can't find any way of doing this either.
Does there already exist a way to differentiate between the errors and set the timeout parameter that I haven't found?
In my application, I need to differentiate between different kinds of errors – timeout, no route to host and connection refused, specifically. The event passed to the onerror function on error has only one element, "data", which contains only the string "Connection error" on all of the errors above.
I also need to adjust the timeout parameter. I can't find any way of doing this either.
Does there already exist a way to differentiate between the errors and set the timeout parameter that I haven't found?