aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/command
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2023-05-10 17:42:26 +1000
committerGitHub <noreply@github.com>2023-05-10 09:42:26 +0200
commitb7b4c4bde154e6177d03367024a6537133841309 (patch)
treed8a6f03816501674971b9e49c76ae10a42c17d21 /src/main/java/at/hannibal2/skyhanni/test/command
parente5d9561f8cdedff4c29a5b6153997a10ceaae921 (diff)
downloadskyhanni-b7b4c4bde154e6177d03367024a6537133841309.tar.gz
skyhanni-b7b4c4bde154e6177d03367024a6537133841309.tar.bz2
skyhanni-b7b4c4bde154e6177d03367024a6537133841309.zip
Fix features and copy error (#97)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/command')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt21
1 files changed, 21 insertions, 0 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
new file mode 100644
index 000000000..e2fbd98c5
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt
@@ -0,0 +1,21 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.OSUtils
+
+object CopyErrorCommand {
+ var errorMessage = ""
+ var errorStackTrace = listOf<StackTraceElement>()
+ fun command() {
+ try {
+ if (errorMessage == "") LorenzUtils.chat("§c[SkyHanni] no error to copy") else {
+ val result = errorMessage + "\nCaused at:\n" + errorStackTrace.joinToString("\n")
+ OSUtils.copyToClipboard(result)
+ LorenzUtils.chat("§e[SkyHanni] error message copied into the clipboard, please report it on the SkyHanni discord!")
+ }
+ } catch (error: Throwable) {
+ OSUtils.copyToClipboard(error.toString())
+ LorenzUtils.chat("§c[SkyHanni] error occurred while fetching error, please report this on the SkyHanni discord!")
+ }
+ }
+} \ No newline at end of file