diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-22 17:54:43 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-22 17:54:43 +0200 |
commit | 25962a047b310662f923917d96cd96a1d3a16965 (patch) | |
tree | 1b7134ad91ac0d9d90e6609487471b27d979b3de | |
parent | c4acb66a4b6ab9498659613b5193a06044d3fd47 (diff) | |
download | skyhanni-25962a047b310662f923917d96cd96a1d3a16965.tar.gz skyhanni-25962a047b310662f923917d96cd96a1d3a16965.tar.bz2 skyhanni-25962a047b310662f923917d96cd96a1d3a16965.zip |
sending the normal stack trace in the console as normal
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt index ccaeee6ef..112768637 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt @@ -36,15 +36,17 @@ object CopyErrorCommand { } ?: "§c[SkyHanni] Error id not found!") } - fun logError(error: Throwable, message: String) { - Minecraft.getMinecraft().thePlayer ?: throw Error(message, error) + fun logError(throwable: Throwable, message: String) { + val error = Error(message, throwable) + Minecraft.getMinecraft().thePlayer ?: throw error + error.printStackTrace() - val pair = error.stackTrace[0].let { it.fileName to it.lineNumber } + val pair = throwable.stackTrace[0].let { it.fileName to it.lineNumber } if (cache.getIfPresent(pair) != null) return cache.put(pair, Unit) - val fullStackTrace = error.getExactStackTrace(true).joinToString("\n") - val stackTrace = error.getExactStackTrace(false).joinToString("\n").removeSpam() + val fullStackTrace = throwable.getExactStackTrace(true).joinToString("\n") + val stackTrace = throwable.getExactStackTrace(false).joinToString("\n").removeSpam() val randomId = UUID.randomUUID().toString() errorMessages[randomId] = "```\nSkyHanni ${SkyHanniMod.version}: $message\n \n$stackTrace\n```" |