From 5838f6ed6955711e65ae38ebb8569008999f3b8a Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 30 Mar 2022 16:49:40 +0200 Subject: [PATCH 1/2] Improve error logging Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ErrorLogger.java | 7 +------ .../steamwar/bungeecore/bot/SteamwarDiscordBot.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/bungeecore/ErrorLogger.java b/src/de/steamwar/bungeecore/ErrorLogger.java index 17799be..2dfe653 100644 --- a/src/de/steamwar/bungeecore/ErrorLogger.java +++ b/src/de/steamwar/bungeecore/ErrorLogger.java @@ -85,13 +85,8 @@ public class ErrorLogger extends Handler { static { List contains = new ArrayList<>(); - contains.add("ServerConnector"); - contains.add("InitialHandler"); - contains.add("UpstreamBridge"); - contains.add("DownstreamBridge"); - contains.add(" took "); - contains.add("No client connected for pending server!"); contains.add("Error authenticating "); + contains.add("read timed out"); ignoreContains = Collections.unmodifiableList(contains); } } diff --git a/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java b/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java index f2f9eed..e193392 100644 --- a/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java +++ b/src/de/steamwar/bungeecore/bot/SteamwarDiscordBot.java @@ -35,6 +35,7 @@ import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.OnlineStatus; import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.entities.Guild; +import net.dv8tion.jda.api.exceptions.ErrorResponseException; import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction; import net.dv8tion.jda.api.utils.MemberCachePolicy; @@ -93,9 +94,13 @@ public class SteamwarDiscordBot { EventManager.update(); SchematicsManager.update(); ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { - activity(); - EventManager.update(); - SchematicsManager.update(); + try { + activity(); + EventManager.update(); + SchematicsManager.update(); + } catch (ErrorResponseException e) { + //ignored + } }, 30, 30, TimeUnit.SECONDS); DiscordRolesMessage.sendMessage(); DiscordRulesMessage.sendMessage(); From 8ce1d668179f1ef44fdc6d64a26fd5978d88c6cc Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 30 Mar 2022 18:27:51 +0200 Subject: [PATCH 2/2] Add Connection reset Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ErrorLogger.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/steamwar/bungeecore/ErrorLogger.java b/src/de/steamwar/bungeecore/ErrorLogger.java index 2dfe653..5e4ffdf 100644 --- a/src/de/steamwar/bungeecore/ErrorLogger.java +++ b/src/de/steamwar/bungeecore/ErrorLogger.java @@ -87,6 +87,7 @@ public class ErrorLogger extends Handler { List contains = new ArrayList<>(); contains.add("Error authenticating "); contains.add("read timed out"); + contains.add("Connection reset by peer"); ignoreContains = Collections.unmodifiableList(contains); } }