Skip to content

Commit

Permalink
Log non-200 on metrics download (Slimefun#4239)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev authored Sep 22, 2024
1 parent b560db1 commit 0a7fea8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ private boolean download(int version) {
downloadMonitor(HttpResponse.BodyHandlers.ofFile(file.toPath()))
);


if (response.statusCode() >= 200 && response.statusCode() < 300) {
plugin.getLogger().log(Level.INFO, "Successfully downloaded {0} build: #{1}", new Object[] { JAR_NAME, version });

Expand All @@ -246,6 +245,8 @@ private boolean download(int version) {
metricVersion = String.valueOf(version);
hasDownloadedUpdate = true;
return true;
} else {
plugin.getLogger().log(Level.WARNING, "Failed to download the latest jar file from GitHub. Response code: {0}", response.statusCode());
}
} catch (InterruptedException | JsonParseException e) {
plugin.getLogger().log(Level.WARNING, "Failed to fetch the latest jar file from the builds page. Perhaps GitHub is down? Response: {0}", e.getMessage());
Expand Down

0 comments on commit 0a7fea8

Please sign in to comment.