From af965ca7b13f5220d97565ee1829043d659a665f Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 28 Oct 2023 19:57:43 +1100 Subject: Added logging to repo error popup (#904) Made the repo error log what file is missing --- .../moulberry/notenoughupdates/commands/help/FeaturesCommand.kt | 2 +- .../github/moulberry/notenoughupdates/commands/help/LinksCommand.kt | 4 ++-- .../kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.kt index 6cc4e255..e98dd7dd 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.kt @@ -40,7 +40,7 @@ class FeaturesCommand { reply("") val url = Constants.MISC?.get("featureslist")?.asString if (url == null) { - Utils.showOutdatedRepoNotification() + Utils.showOutdatedRepoNotification("misc.json or missing featureslist") return@thenExecute } diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.kt index 7a47da2b..dc995936 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.kt @@ -36,14 +36,14 @@ class LinksCommand { val manager = NotEnoughUpdates.INSTANCE.manager val updateJsonFile = manager.repoLocation.resolve("update.json") if (!updateJsonFile.exists()) { - Utils.showOutdatedRepoNotification() + Utils.showOutdatedRepoNotification("update.json") return@thenExecute } try { val updateJson = manager.getJsonFromFile(updateJsonFile) NotEnoughUpdates.INSTANCE.displayLinks(updateJson, 0) } catch (_: Exception) { - Utils.showOutdatedRepoNotification() + Utils.showOutdatedRepoNotification("some error with update.json") } } }.withHelp("Display links for Moulberry and NEU") diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt index 99066e52..9f809798 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt @@ -20,10 +20,10 @@ package io.github.moulberry.notenoughupdates.util import com.google.gson.JsonObject +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay.Rarity import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe @NEUAutoSubscribe object PetLeveling { @@ -94,7 +94,7 @@ object PetLeveling { } val stubExpLadder by lazy { - Utils.showOutdatedRepoNotification() + Utils.showOutdatedRepoNotification("pets.json") ExpLadder(listOf(1, 1)) } -- cgit