Remove conditional on RemoteProtocolError.event_hint#1486
Merged
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. |
Owner
Author
|
The |
9eefe11 to
b809c42
Compare
Co-authored-by: Tom Christie <tom@tomchristie.com>
b809c42 to
cd9018b
Compare
code on events.CloseConnection for wsprotoRemoteProtocolError.event_hint
79129ae to
a5dcf5d
Compare
Owner
Author
|
I've replaced the logic here. 😅 |
lovelydinosaur
approved these changes
Oct 31, 2022
lovelydinosaur
left a comment
There was a problem hiding this comment.
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?
Owner
Author
|
I'm fine with this being merged. Thanks @tomchristie 🙏 As a note, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not sure if this is the right
code, butevents.CloseConnectionreceivescodeas 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...
wsprotodoesn't raise aRemoteProtocolErrorwithout anevent_hint. Check their source code: https://github.com/python-hyper/wsproto/.