python-hyper / wsproto

Sans-IO WebSocket protocol implementation
https://wsproto.readthedocs.io/
MIT License
262 stars 38 forks source link

Continue with the new API, #85, failure handling #95

Closed pgjones closed 5 years ago

pgjones commented 5 years ago

This introduces Local and Remote ProtocolError exceptions that are raised when things go awry do to either the remote or local actions. It replaces ValueError exceptions and the Fail event. It also adapts the principle of #92 to the exceptions named in this pull request (the principle is the same). The naming is taken from h11. Finally the state is exposed as a read only property to allow for any user to know the current connection state.