Bug 137831
Summary: | WebSocket readyState should not throw an exception ever. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Brandon Andrews <sirisian> |
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Brandon Andrews
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).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
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;
}
Alexey Proskuryakov
Please feel free to re-open with a test case.