JsCommunity / jsonrpc-websocket-client

JSON-RPC 2 over WebSocket
6 stars 1 forks source link

Is there a way to know what websocket error it throws? #41

Closed yingfangdu closed 5 years ago

yingfangdu commented 5 years ago

Hi, When I use the library, I got a couple of different WebSocket connection failures of ERR_CONNECTION_REFUSED, ERR_NETWORK_IO_SUSPENDED or ERR_CONNECTION_TIMED_OUT

Is there a way that I get the detail error thrown from WebSocket instead of simply a ConnectionError without much information?

Thanks very much.

julien-f commented 5 years ago

Hi,

When do you get this error?

Can you show me a small code reproducing the issue?

yingfangdu commented 5 years ago

Thanks for reply. ERR_CONNECTION_REFUSED is easy to repro locally if you let the WebSocket connect to some port that no server is listening too.

ERR_NETWORK_IO_SUSPENDED happens when the machine just goes to sleep mode, you can use a laptop and set the power plan like this.

image

ERR_CONNECTION_TIMED_OUT I cannot repro it. I guess maybe the server is very busying and do not reply in a required time frame.

julien-f commented 5 years ago

Released as 0.5.0, thank you for your report.