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

Move error handling #174

Merged
merged 4 commits into from
Apr 11, 2023
Merged

Conversation

Erk-
Copy link
Member

@Erk- Erk- commented Apr 10, 2023

Move the place where we look away from the json error to be higher up as discussed on Discord

@Erk- Erk- requested a review from FelixMcFelix April 10, 2023 13:52
Copy link
Member

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

Apologies for pushing direct to your branch, please let me know if you're happy with this approach as well.

Basically, the reconnection pathway after an error will also be hit by the same bug, so all checks are moved into convert_ws_message. Given that Discord will now apparently send other WS events during the handshake, I've also demoted all non-{Hello, Ready, Resumed} messages during handshakes to logs rather than an explicit error,

@FelixMcFelix FelixMcFelix merged commit 7cbfbe7 into serenity-rs:current Apr 11, 2023
luqmana pushed a commit to luqmana/songbird that referenced this pull request Apr 12, 2023
Moves all WS handling of unexpected payloads into the stream to prevent code duplication.

This also prevents non-{Hello,Resumed,Ready} messages from causing a handshake failure, as it seems Discord do not prevent such messages from appearing.

---------

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
FelixMcFelix added a commit to FelixMcFelix/songbird that referenced this pull request Apr 20, 2023
Moves all WS handling of unexpected payloads into the stream to prevent code duplication.

This also prevents non-{Hello,Resumed,Ready} messages from causing a handshake failure, as it seems Discord do not prevent such messages from appearing.

---------

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
FelixMcFelix added a commit to FelixMcFelix/songbird that referenced this pull request Apr 20, 2023
Moves all WS handling of unexpected payloads into the stream to prevent code duplication.

This also prevents non-{Hello,Resumed,Ready} messages from causing a handshake failure, as it seems Discord do not prevent such messages from appearing.

---------

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
FelixMcFelix added a commit to FelixMcFelix/songbird that referenced this pull request Nov 20, 2023
Moves all WS handling of unexpected payloads into the stream to prevent code duplication.

This also prevents non-{Hello,Resumed,Ready} messages from causing a handshake failure, as it seems Discord do not prevent such messages from appearing.

---------

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
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