From 64239c686d15ffa91c9c9212402e08c09ec8949f Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:30:26 +1100 Subject: Fix: Profile name on alpha (#1120) --- .../garden/farming/FarmingWeightDisplay.kt | 23 ++++++++++++---------- .../at/hannibal2/skyhanni/utils/UtilsPatterns.kt | 2 +- 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(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: §r§a(?\\S+).*" ) } -- cgit