-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
More informative assert errors for WebsocketCommunicator. #2098
Conversation
assert response["type"] == "websocket.send" | ||
assert ( | ||
response["type"] == "websocket.send" | ||
), f"Expected type 'websocket.send', but was '{response['type']}'" |
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.
This is the useful and important one, the rest I added only for sake of completion.
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.
Hi @hovi — this looks reasonable, yes. Thanks!
Just one comment…
Co-authored-by: Carlton Gibson <[email protected]>
If you can fix the lint error, we're good to go. |
I believe I just did. Are you squashing or should I cleanup commits? |
Thanks @hovi 🎁 |
My pleasure, thanks for quick review! |
Already happened to me twice, that this AssertionError got me puzzled for a bit (being channels newbie and coming back after months), until I figured out, what was going on (socket closed unexpectedly while I wanted to read from it).
Having this kind of informative message would give me immediate hint and make my debugging much faster.