We were trying to only catch WebSocketException, but in fact SocketException can be thrown as well.
Fixes #13655