diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-09 12:31:24 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-09 12:31:24 +0100 |
commit | bba11f79532a7c70855af1ee00bff1c966fdf62d (patch) | |
tree | 27fdb427789a0e12afa588357a3cbeadcd85c988 /src/main | |
parent | 4c2608d8aa3c43a01b83192141f7ce2cfbc78a11 (diff) | |
download | skyhanni-bba11f79532a7c70855af1ee00bff1c966fdf62d.tar.gz skyhanni-bba11f79532a7c70855af1ee00bff1c966fdf62d.tar.bz2 skyhanni-bba11f79532a7c70855af1ee00bff1c966fdf62d.zip |
Added additional error information to an composter inventory error
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt index 3c27842a6..75e62468f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -35,7 +36,16 @@ class GardenComposterInventoryFeatures { var amountItems = 0 for (originalLine in list) { i++ - val line = originalLine.substring(4) + val line = try { + originalLine.substring(4) + } catch (e: Throwable) { + ErrorManager.logErrorWithData( + e, "Error reading composter data.", + "originalLine" to originalLine, + "list" to list, + ) + return + } if (line == "ยง7Upgrade Cost:") { next = true indexFullCost = i |