diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-21 11:16:34 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-21 11:16:34 +0200 |
commit | 830fdb7022ac173b421daeddfbc7e67c0d9f891b (patch) | |
tree | a9e4397add1cc121e9cea0a35500de5ccd66f5a9 /src/main/java/at/hannibal2/skyhanni/features/chat | |
parent | 020c278b3c6cdff38449e0fe67bb36bf196ed045 (diff) | |
download | skyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.tar.gz skyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.tar.bz2 skyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.zip |
better repo error handling
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt index af0d1b805..6de251af5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt @@ -29,25 +29,18 @@ class PlayerChatFilter { var countCategories = 0 var countFilters = 0 - try { - val data = event.getConstant("PlayerChatFilter") ?: return - - for (category in data["filters"].asJsonArray) { - val jsonObject = category.asJsonObject - val description = jsonObject["description"].asString - val filter = MultiFilter() - filter.load(jsonObject) - filters[description] = filter - - countCategories++ - countFilters += filter.count() - } - - LorenzUtils.debug("Loaded $countFilters filters in $countCategories categories from repo") - - } catch (e: Exception) { - e.printStackTrace() - LorenzUtils.error("error in RepositoryReloadEvent") + val data = event.getConstant("PlayerChatFilter") + for (category in data["filters"].asJsonArray) { + val jsonObject = category.asJsonObject + val description = jsonObject["description"].asString + val filter = MultiFilter() + filter.load(jsonObject) + filters[description] = filter + + countCategories++ + countFilters += filter.count() } + + LorenzUtils.debug("Loaded $countFilters filters in $countCategories categories from repo") } -}
\ No newline at end of file +} |