aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt23
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt2
2 files changed, 14 insertions, 11 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 5147df33b..a4d5959b0 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
@@ -449,6 +449,8 @@ class FarmingWeightDisplay {
val url = "https://api.elitebot.dev/weight/$uuid"
val apiResponse = APIUtil.getJSONResponse(url)
+ var error: Throwable? = null
+
try {
val apiData = ConfigManager.gson.fromJson<EliteWeightJson>(apiResponse)
@@ -469,18 +471,19 @@ class FarmingWeightDisplay {
}
} catch (e: Exception) {
- ErrorManager.logErrorWithData(
- e, "Error loading user farming weight",
- "url" to url,
- "apiResponse" to apiResponse,
- "localProfile" to localProfile
- )
+ error = e
}
apiError = true
- ErrorManager.skyHanniError(
- "Loading the farming weight data from elitebot.dev failed!\n"
- + "§eYou can re-enter the garden to try to fix the problem.\n" +
- "§cIf this message repeats, please report it on Discord!",
+
+ ErrorManager.logErrorWithData(
+ error ?: IllegalStateException("Error loading user farming weight"),
+ "Error loading user farming weight\n" +
+ "§eLoading the farming weight data from elitebot.dev failed!\n" +
+ "§eYou can re-enter the garden to try to fix the problem.\n" +
+ "§cIf this message repeats, please report it on Discord!\n",
+ "url" to url,
+ "apiResponse" to apiResponse,
+ "localProfile" to localProfile
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt
index 42ff1a06d..b6781bde0 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt
@@ -86,6 +86,6 @@ object UtilsPatterns {
val tabListProfilePattern by patternGroup.pattern(
"tablist.profile",
- "(?:§.)+Profile: §r§a(?<profile>.*)"
+ "(?:§.)+Profile: §r§a(?<profile>\\S+).*"
)
}