private static Code extractStatusCode(final Throwable message) { assertThat(message, is(instanceOf(UpgradeException.class))); return HttpStatus.getCode(((UpgradeException) message).getResponseStatusCode()); }
throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Didn't switch protocols"); if (!"upgrade".equalsIgnoreCase(connection)) throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Connection is " + connection + " (expected upgrade)"); throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Invalid Sec-WebSocket-Accept hash");
throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Didn't switch protocols"); if (!"upgrade".equalsIgnoreCase(connection)) throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Connection is " + connection + " (expected upgrade)"); throw new UpgradeException(request.getRequestURI(),response.getStatusCode(),"Invalid Sec-WebSocket-Accept hash");
UpgradeException ue = new UpgradeException(request.getRequestURI(),e); connectPromise.failed(ue); disconnect(false);
Map<String, Object> failure = new HashMap<>(2); failure.put("websocketCode", 1002); failure.put("httpCode", x.getResponseStatusCode()); listener.onFailure(new TransportException(x, failure), messages); } catch (Throwable x) {
UpgradeException ue = new UpgradeException(request.getRequestURI(),e); connectPromise.failed(ue); disconnect(false);
handleException(new UpgradeException(requestURI,responseStatusCode,responseLine,failure)); handleException(new UpgradeException(requestURI,responseStatusCode,"Failed to upgrade to websocket: Unexpected HTTP Response Status Code: " + responseLine));