Webkit currently throws an exception if a handshake fails and the user attempts to access the readyState member. The following exception can be seen with Webkit's implementation when a handshake is interrupted: WebSocket connection to 'wss://example.com' failed: Connection closed before receiving a handshake response This should simply close the connection and set the readyState to CLOSED and call the onerror event. Having readyState throw an exception for this is unintuitive. (I don't think any other browser does this).
Could you please provide a test case? Looking at the readState attribute implementation, there is no way it could possibly raise an exception on getting. It doesn't even have a way to return an exception code: WebSocket::State WebSocket::readyState() const { return m_state; }
Please feel free to re-open with a test case.