aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-21 11:16:34 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-21 11:16:34 +0200
commit830fdb7022ac173b421daeddfbc7e67c0d9f891b (patch)
treea9e4397add1cc121e9cea0a35500de5ccd66f5a9 /src/main/java/at/hannibal2/skyhanni/test
parent020c278b3c6cdff38449e0fe67bb36bf196ed045 (diff)
downloadskyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.tar.gz
skyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.tar.bz2
skyhanni-830fdb7022ac173b421daeddfbc7e67c0d9f891b.zip
better repo error handling
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt
index 06983d328..00ea73570 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt
@@ -53,13 +53,12 @@ class HighlightMissingRepoItems {
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
- event.getConstant("IgnoredItems")?.let {
- ignoreItems.load(it.asJsonObject)
- }
+ val ignoredItems = event.getConstant("IgnoredItems")
+ ignoreItems.load(ignoredItems.asJsonObject)
}
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(3, "dev.highlightMissingRepo", "dev.debug.highlightMissingRepo")
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
index c0d3fd169..7db251300 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
@@ -17,6 +17,10 @@ object ErrorManager {
private var cache =
CacheBuilder.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build<Pair<String, Int>, Unit>()
+ fun resetCache() {
+ cache.asMap().clear()
+ }
+
fun skyHanniError(message: String): Nothing {
val exception = IllegalStateException(message)
logError(exception, message)