aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/command
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-17 11:41:27 +0100
committerGitHub <noreply@github.com>2024-03-17 11:41:27 +0100
commit70d28d6e2ec3fdb9babe632d49c36fad6e7f683c (patch)
tree631500e238aeec2a1ae19913977ec9f4a4379d04 /src/main/java/at/hannibal2/skyhanni/test/command
parent6137bea273ef3e8932af218b45fd27c42d355d6e (diff)
downloadskyhanni-70d28d6e2ec3fdb9babe632d49c36fad6e7f683c.tar.gz
skyhanni-70d28d6e2ec3fdb9babe632d49c36fad6e7f683c.tar.bz2
skyhanni-70d28d6e2ec3fdb9babe632d49c36fad6e7f683c.zip
Fix: OpenBrowser Crash (#1195)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/command')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt11
1 files changed, 5 insertions, 6 deletions
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 16757d255..e7d0fa3cb 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt
@@ -113,18 +113,17 @@ object ErrorManager {
noStackTrace: Boolean,
vararg extraData: Pair<String, Any?>,
) {
- val error = Error(message, throwable)
- error.printStackTrace()
- Minecraft.getMinecraft().thePlayer ?: return
-
if (!ignoreErrorCache) {
val pair = if (throwable.stackTrace.isNotEmpty()) {
- throwable.stackTrace[0].let { it.fileName!! to it.lineNumber }
+ throwable.stackTrace[0].let { (it.fileName ?: "<unknown>") to it.lineNumber }
} else message to 0
if (cache.contains(pair)) return
cache.add(pair)
}
+ Error(message, throwable).printStackTrace()
+ Minecraft.getMinecraft().thePlayer ?: return
+
val fullStackTrace: String
val stackTrace: String
@@ -175,7 +174,7 @@ object ErrorManager {
private fun Throwable.getCustomStackTrace(
fullStackTrace: Boolean,
- parent: List<String> = emptyList()
+ parent: List<String> = emptyList(),
): List<String> = buildList {
add("Caused by ${this@getCustomStackTrace.javaClass.name}: $message")