From f396cd9b928aa3a3ff7725b76551178b6bb80052 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 14 Oct 2020 19:23:00 -0300 Subject: [PATCH] fix: Cancel reconnection when 4014 (#1603) * Cancel reconnection when 4014 * Missed an else --- src/Discord.Net.WebSocket/ConnectionManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Discord.Net.WebSocket/ConnectionManager.cs b/src/Discord.Net.WebSocket/ConnectionManager.cs index e009674e7..2237e2d1f 100644 --- a/src/Discord.Net.WebSocket/ConnectionManager.cs +++ b/src/Discord.Net.WebSocket/ConnectionManager.cs @@ -44,6 +44,8 @@ namespace Discord var ex2 = ex as WebSocketClosedException; if (ex2?.CloseCode == 4006) CriticalError(new Exception("WebSocket session expired", ex)); + else if (ex2?.CloseCode == 4014) + CriticalError(new Exception("WebSocket connection was closed", ex)); else Error(new Exception("WebSocket connection was closed", ex)); }