Closed dkumiszhan closed 1 year ago
new WebSocket() does not throw an error which the current logic seems to expect. Some background here.
new WebSocket()
We can handle it by adding onerror callback but choosing the protocol based on location.protocol seems to be cleaner.
onerror
location.protocol
@dkumiszhan This is a great solution. Error was not getting caught in my case too, tried your solution and its working as expected.
new WebSocket()
does not throw an error which the current logic seems to expect. Some background here.We can handle it by adding
onerror
callback but choosing the protocol based onlocation.protocol
seems to be cleaner.