From ce7340ce945e6398fa77aaaea950f0e732971280 Mon Sep 17 00:00:00 2001 From: OakLoaf Date: Wed, 16 Oct 2024 16:00:12 +0100 Subject: [PATCH] Silenced 404 error from spiget search --- .../pluginupdater/collector/SpigotCollector.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/lushplugins/pluginupdater/collector/SpigotCollector.java b/src/main/java/org/lushplugins/pluginupdater/collector/SpigotCollector.java index de280fc..1d5440a 100644 --- a/src/main/java/org/lushplugins/pluginupdater/collector/SpigotCollector.java +++ b/src/main/java/org/lushplugins/pluginupdater/collector/SpigotCollector.java @@ -38,12 +38,16 @@ public List collectPlugins(Collection unknownPlugins) { try { response = HttpUtil.sendRequest(String.format("%s/search/resources/%s", UpdaterConstants.APIs.SPIGET, unknownPlugin.getName())); } catch (IOException | InterruptedException e) { - PluginUpdater.getInstance().getLogger().log(Level.WARNING, "Caught error whilst getting project data from hashes: ", e); + PluginUpdater.getInstance().getLogger().log(Level.WARNING, "Caught error whilst searching for project on spiget: ", e); + return null; + } + + if (response.statusCode() == 404) { return null; } if (response.statusCode() != 200) { - PluginUpdater.getInstance().getLogger().log(Level.WARNING, "Received invalid response code (" + response.statusCode() + ") whilst getting project data from hashes."); + PluginUpdater.getInstance().getLogger().log(Level.WARNING, "Received invalid response code (" + response.statusCode() + ") whilst searching for project on spiget (" + response.uri() + ")"); return null; }