aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-01 09:06:59 +0100
committerGitHub <noreply@github.com>2024-03-01 09:06:59 +0100
commit498eb136629d3f2b22f217ebec60b60761e1b899 (patch)
treea34cc8ab028d7e7b069dfc561692a0b0880e5fcf /src/main/java/at/hannibal2/skyhanni/features/garden
parent8b0e4335fd4876bb4dfb2325200118435aae2624 (diff)
downloadskyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.tar.gz
skyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.tar.bz2
skyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.zip
printStackTrace -> ErrorManager #1028
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt8
3 files changed, 28 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
index 6fce2122d..8b38e801b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI.addCropIcon
+import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.APIUtil
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ConfigUtils
@@ -451,7 +452,10 @@ object GardenNextJacobContest {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
} catch (e: java.lang.Exception) {
- e.printStackTrace()
+ ErrorManager.logErrorWithData(
+ e, "Failed to open a popup window",
+ "message" to message
+ )
}
val frame = JFrame()
@@ -571,8 +575,11 @@ object GardenNextJacobContest {
saveConfig()
}
} catch (e: Exception) {
- e.printStackTrace()
- ChatUtils.error("Failed to fetch upcoming contests. Please report this error if it continues to occur.")
+ ErrorManager.logErrorWithData(
+ e,
+ "Failed to fetch upcoming contests. Please report this error if it continues to occur"
+ )
+
}
}
@@ -604,11 +611,14 @@ object GardenNextJacobContest {
if (result) {
ChatUtils.chat("Successfully submitted this years upcoming contests, thank you for helping everyone out!")
} else {
- ChatUtils.error("Something went wrong submitting upcoming contests!")
+ ErrorManager.logErrorStateWithData("Something went wrong submitting upcoming contests!",
+ "submitContestsToElite not sucessful")
}
} catch (e: Exception) {
- e.printStackTrace()
- ChatUtils.error("Failed to submit upcoming contests. Please report this error if it continues to occur.")
+ ErrorManager.logErrorWithData(
+ e, "Failed to submit upcoming contests. Please report this error if it continues to occur.",
+ "contests" to contests
+ )
null
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index 08e6382c1..48c2f8a0c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -20,6 +20,7 @@ import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.composter.ComposterAPI.getLevel
import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue
+import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc
@@ -550,8 +551,10 @@ object ComposterOverlay {
try {
organicMatterFactors = updateOrganicMatterFactors(organicMatter)
} catch (e: Exception) {
- e.printStackTrace()
- ChatUtils.error("error in RepositoryReloadEvent")
+ ErrorManager.logErrorWithData(
+ e, "Failed to calculate composter overlay data",
+ "organicMatter" to organicMatter
+ )
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
index 83a4c68ca..84e63ce18 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
@@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.features.garden.CropType
import at.hannibal2.skyhanni.features.garden.CropType.Companion.getByNameOrNull
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest
+import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay
import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed
import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.isSpeedDataEmpty
import at.hannibal2.skyhanni.test.command.ErrorManager
@@ -204,7 +205,12 @@ object CropMoneyDisplay {
list.add(getItemStack("BOX_OF_SEEDS"))
}
} catch (e: NullPointerException) {
- e.printStackTrace()
+ ErrorManager.logErrorWithData(
+ e, "Error calculating seed price for money per hour display",
+ "internalName" to internalName,
+ "cropNames" to cropNames,
+ "list" to list,
+ )
}
if (!config.compact) {