Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP reponse errors raise ProtocolError, but should raise some HTTPError with the actual status code #9

Open
SpComb opened this issue Jul 24, 2017 · 0 comments

Comments

@SpComb
Copy link
Contributor

SpComb commented Jul 24, 2017

Client code might be interested in handling specific websocket handshake HTTP errors like 404, 403 etc differently. These currently just result in generic human-readable messages like raise Kontena::Websocket::ProtocolError, "Error during WebSocket handshake: Unexpected response code: 404", which are clumsy to deal with.

Looks like the Websocket::Driver::Client will set the http @status and @headers before failing the handshake and emitting the error.

The same error also gets emitted on things like Invalid HTTP response, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant