Skip to content

Commit 15f0676

Browse files
committed
on bad websocket upgrade, include the bad status code in the exception
"Illegal Upgrade protocol" isn't very clear that the problem is 1) a bad status or 2) what the bad status was.
1 parent c0f338c commit 15f0676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/websocket/WebSocketUpgradeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public final STATE onStatusReceived(HttpResponseStatus responseStatus) throws Ex
6464
if (responseStatus.getStatusCode() == 101) {
6565
return STATE.UPGRADE;
6666
} else {
67-
throw new IllegalStateException("Invalid Upgrade protocol");
67+
throw new IllegalStateException("Invalid upgrade protocol, status should be 101 but was " + responseStatus.getStatusCode());
6868
}
6969
}
7070

0 commit comments

Comments
 (0)