Open
Description
Is it possible to add response.statusCode
in WebSocketException?
for example when server response other statusCode, we can handle it in catchError
if (response.statusCode != HttpStatus.SWITCHING_PROTOCOLS ||
response.headers[HttpHeaders.CONNECTION] == null ||
!response.headers[HttpHeaders.CONNECTION]
.any((value) => value.toLowerCase() == "upgrade") ||
response.headers.value(HttpHeaders.UPGRADE).toLowerCase() !=
"websocket") {
error("Connection to '$uri' was not upgraded to websocket");
}
``