Fix: Move WS error handling (#174)
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>
This commit is contained in:
@@ -90,7 +90,6 @@ impl From<&ConnectionError> for DisconnectReason {
|
||||
| ConnectionError::CryptoModeInvalid
|
||||
| ConnectionError::CryptoModeUnavailable
|
||||
| ConnectionError::EndpointUrl
|
||||
| ConnectionError::ExpectedHandshake
|
||||
| ConnectionError::IllegalDiscoveryResponse
|
||||
| ConnectionError::IllegalIp
|
||||
| ConnectionError::Json(_) => Self::ProtocolViolation,
|
||||
|
||||
Reference in New Issue
Block a user