diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-03-01 21:51:05 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 11:51:05 +0100 |
commit | a0b81d3592883225988e058b7de87d33fa2dddf3 (patch) | |
tree | 14ae161cfa4104cc6e4085d0a341e27740decb97 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 8e9109d3b190f5451793fe79929ac89b3876c4ff (diff) | |
download | skyhanni-a0b81d3592883225988e058b7de87d33fa2dddf3.tar.gz skyhanni-a0b81d3592883225988e058b7de87d33fa2dddf3.tar.bz2 skyhanni-a0b81d3592883225988e058b7de87d33fa2dddf3.zip |
Replaced e.printStackTrace() with ErrorManager. #1065
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
9 files changed, 13 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index e7b1679cd..eaa7f87cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -431,7 +431,6 @@ class FarmingWeightDisplay { "url" to url, "apiResponse" to apiResponse ) - error() } return -1 } @@ -470,13 +469,10 @@ class FarmingWeightDisplay { ErrorManager.logErrorWithData( e, "Error loading user farming weight", "url" to url, - "apiResponse" to apiResponse + "apiResponse" to apiResponse, + "localProfile" to localProfile ) } - error() - } - - private fun error() { apiError = true ErrorManager.skyHanniError( "Loading the farming weight data from elitebot.dev failed!\n" diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 0ac715598..eec532ed1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt @@ -116,7 +116,7 @@ object GardenCropMilestoneDisplay { } cultivatingData[crop] = counter } catch (e: Throwable) { - ErrorManager.logError(e, "Updating crop counter by reading farming tool nbt data.") + ErrorManager.logErrorWithData(e, "Updating crop counter by reading farming tool nbt data.") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 1274bf2e8..4b74271e4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -170,7 +170,7 @@ object GardenVisitorDropStatistics { ) } else { addAsSingletonList("§c?") - ErrorManager.logError( + ErrorManager.logErrorWithData( RuntimeException("visitorRarities is empty, maybe visitor refusing was the cause?"), "Error rendering visitor drop statistics" ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt index c631165d3..09e02c94f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt @@ -70,7 +70,7 @@ class GardenVisitorTimer { try { updateVisitorDisplay() } catch (error: Throwable) { - ErrorManager.logError(error, "Encountered an error when updating visitor display") + ErrorManager.logErrorWithData(error, "Encountered an error when updating visitor display") } try { GardenVisitorDropStatistics.saveAndUpdate() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index a5a9c8900..daaf6c8be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -200,9 +200,9 @@ class NonGodPotEffectDisplay { val duration = try { TimeUtils.getMillis(line.split("§f")[1]) } catch (e: IndexOutOfBoundsException) { - ErrorManager.logError( - Exception("'§f' not found in line '$line'", e), - "Error while reading Non God-Potion effects from tab list" + ErrorManager.logErrorWithData( + e, "Error while reading Non God-Potion effects from tab list", + "line" to line ) continue } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt index f1fb205e5..2d241dd9c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt @@ -179,7 +179,7 @@ object QuickModMenuSwitch { } } } catch (e: Exception) { - ErrorManager.logError(e, "Error trying to open the gui for mod " + mod.name) + ErrorManager.logErrorWithData(e, "Error trying to open the gui for mod " + mod.name) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt index 5110c3752..bc7875822 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt @@ -211,7 +211,7 @@ object DiscordRPCManager : IPCListener { try { start(true) } catch (e: Exception) { - ErrorManager.logError( + ErrorManager.logErrorWithData( e, "Unable to start Discord Rich Presence! Please report this on Discord and ping @netheriteminer." ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index 11d6e68ad..ffd25c4e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -94,7 +94,7 @@ object TrevorFeatures { TrevorTracker.calculatePeltsPerHour() if (questActive) TrevorSolver.findMob() } catch (error: Throwable) { - ErrorManager.logError(error, "Encountered an error when updating the trapper solver") + ErrorManager.logErrorWithData(error, "Encountered an error when updating the trapper solver") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt index a52c9d208..79d6cc130 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt @@ -591,8 +591,8 @@ open class VisualWordGui : GuiScreen() { SkyHanniMod.feature.storage.visualWordsImported = true drawImport = false } - } catch (t: Throwable) { - ErrorManager.logError(t, "Failed to load visual words from SBE") + } catch (e: Throwable) { + ErrorManager.logErrorWithData(e, "Failed to load visual words from SBE") } } |