-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Remove conditional on RemoteProtocolError.event_hint
#1486
Conversation
code
on events.CloseConnection
for wsproto
Well spotted. How about we use 1002 "Protocol Error"? That seems like it'd fit quite well here. |
The |
9eefe11
to
b809c42
Compare
Co-authored-by: Tom Christie <tom@tomchristie.com>
b809c42
to
cd9018b
Compare
code
on events.CloseConnection
for wsproto
RemoteProtocolError.event_hint
79129ae
to
a5dcf5d
Compare
I've replaced the logic here. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we pause this until there's a resolution to python-hyper/wsproto#178, or are we okay with knowing that event_hint
isn't ever None
in this context, although it's annotated as Optional
?
I'm fine with this being merged. Thanks @tomchristie 🙏 As a note, |
I'm not sure if this is the right
code
, butevents.CloseConnection
receivescode
as a mandatory field, so without it, you'll have an exception on missing parameters.List of codes: https://www.iana.org/assignments/websocket/websocket.xhtml
RFC: https://www.rfc-editor.org/rfc/rfc6455.html
I've noticed this issue while annotating
wsproto_impl
.EDIT: Quite funny...
wsproto
doesn't raise aRemoteProtocolError
without anevent_hint
. Check their source code: https://github.com/python-hyper/wsproto/.