graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

WebSocket close status and reason not handled

Open stbjin opened this issue 1 year ago • 1 comments

When the ws socket gets closed by peer, a closeResponse object is created but never used. As the peer also is able to specify a close status + reason if would be nice to fetch these as well.

Today an exception is thrown with the message "Connection closed by the server", making it hard to take action as the reason for closure isn't known. My proposal is to throw a custom exception, including the close status, reason and the closeResponse message.

stbjin avatar Nov 06 '24 13:11 stbjin