diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-03-08 20:30:26 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 10:30:26 +0100 |
commit | 64239c686d15ffa91c9c9212402e08c09ec8949f (patch) | |
tree | fbdc178851f1535c9fcc659d7bcfa9561d20dd37 /src/main/java/at | |
parent | 37f9c2fd312097ca539afacd6d04a24310dcd731 (diff) | |
download | skyhanni-64239c686d15ffa91c9c9212402e08c09ec8949f.tar.gz skyhanni-64239c686d15ffa91c9c9212402e08c09ec8949f.tar.bz2 skyhanni-64239c686d15ffa91c9c9212402e08c09ec8949f.zip |
Fix: Profile name on alpha (#1120)
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt | 23 | ||||
-rw-r--r-- | src/main/java/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<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+).*" ) } |