fix: detect gateway close and failure to reconnect
This commit is contained in:
@@ -337,11 +337,14 @@ async fn handle_events(command_router: Arc<CommandRouter>, state: State, mut sha
|
|||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
match event_res {
|
match event_res {
|
||||||
|
Ok(twilight_model::gateway::event::Event::GatewayClose(frame_option)) => {
|
||||||
|
tracing::warn!(?frame_option);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Ok(event) => {
|
Ok(event) => {
|
||||||
handle_event(command_router.clone(), state.clone(), event).await;
|
handle_event(command_router.clone(), state.clone(), event).await;
|
||||||
}
|
}
|
||||||
Err(twilight_model::gateway::event::Event::GatewayClose(frame_option)) => {
|
Err(reconnect_error) if reconnect_error.kind() == twilight_gateway::error::ReceiveMessageErrorType::Reconnect => {
|
||||||
tracing::warn!(?frame_option);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user