Improved the GitHub "download data" messages

added a message to tell the download is done
made the "could not connect" message only show if isLogGitHubDownloadData() is set to true
This commit is contained in:
Florian CUNY 2019-07-07 08:06:16 +02:00 committed by GitHub
parent b6fcf511a6
commit f44b36267d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,11 +70,18 @@ public class WebManager {
topicsContent = repo.getContent("catalog/topics.json").getContent().replaceAll("\\n", "");
catalogContent = repo.getContent("catalog/catalog.json").getContent().replaceAll("\\n", "");
} catch (IllegalAccessException e) {
plugin.log("Could not connect to GitHub.");
if (plugin.getSettings().isLogGithubDownloadData()) {
plugin.log("Could not connect to GitHub.");
}
} catch (Exception e) {
plugin.logError("An error occurred when downloading from GitHub...");
plugin.logError("An error occurred when downloading data from GitHub...");
plugin.logStacktrace(e);
}
// People were concerned that the download took ages, so we need to tell them it's over now.
if (plugin.getSettings().isLogGithubDownloadData()) {
plugin.log("Successfully downloaded data from GitHub.");
}
// Decoding the Base64 encoded contents
tagsContent = new String(Base64.getDecoder().decode(tagsContent), StandardCharsets.UTF_8);