Skip to content

Commit

Permalink
Silenced 404 error from spiget search
Browse files Browse the repository at this point in the history
  • Loading branch information
OakLoaf committed Oct 16, 2024
1 parent 92ccf67 commit ce7340c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ public List<PluginData> collectPlugins(Collection<JavaPlugin> 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;
}

Expand Down

0 comments on commit ce7340c

Please sign in to comment.