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

connection error handling: unsupported version, unsupported transport, bad handshake method #21

Merged
merged 6 commits into from
Jun 18, 2023

Conversation

biryukovmaxim
Copy link
Contributor

@biryukovmaxim biryukovmaxim commented Jun 17, 2023

In case of request contains unsupported transport or version, the server replies with code and message according
protocol

Code | Message
-- | --
0 | "Transport unknown"
1 | "Session ID unknown"
2 | "Bad handshake method"
3 | "Bad request"
5 | "Unsupported protocol version"

@Totodore
Copy link
Owner

That's great !

Could you add some unit tests for the custom errors ?

@biryukovmaxim
Copy link
Contributor Author

That's great !

Could you add some unit tests for the custom errors ?

Sure, I will

@biryukovmaxim biryukovmaxim changed the title connection error handling: unsupported version, unsupported transport connection error handling: unsupported version, unsupported transport, bad handshake method Jun 18, 2023
handle transport mismatch error;
conn upgrades to ws if only necessary
@biryukovmaxim
Copy link
Contributor Author

@Totodore
also I added handling of "unknown session id" and "transport mismatch", but that's not easy to write unit tests for them, I think it should be covered by integration tests

Copy link
Owner

@Totodore Totodore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging :). If later you wan't to start adding integration tests don't hesitate.

@Totodore Totodore merged commit f641737 into Totodore:main Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants