diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-03-01 09:06:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 09:06:59 +0100 |
commit | 498eb136629d3f2b22f217ebec60b60761e1b899 (patch) | |
tree | a34cc8ab028d7e7b069dfc561692a0b0880e5fcf /src/main/java/at/hannibal2/skyhanni/data | |
parent | 8b0e4335fd4876bb4dfb2325200118435aae2624 (diff) | |
download | skyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.tar.gz skyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.tar.bz2 skyhanni-498eb136629d3f2b22f217ebec60b60761e1b899.zip |
printStackTrace -> ErrorManager #1028
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt | 26 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt | 8 |
2 files changed, 24 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt index 380ecbb8e..4a42001df 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt @@ -83,7 +83,12 @@ class RepoManager(private val configLocation: File) { latestRepoCommit = commits["sha"].asString } } catch (e: Exception) { - e.printStackTrace() + ErrorManager.logErrorWithData( + e, + "Error while loading data from repo", + "command" to command, + "currentCommitJSON" to currentCommitJSON, + ) } if (latestRepoCommit == null || latestRepoCommit!!.isEmpty()) return@supplyAsync false val file = File(configLocation, "repo") @@ -118,13 +123,12 @@ class RepoManager(private val configLocation: File) { ) } } catch (e: IOException) { - Exception( - "Failed to download SkyHanni Repo! Please report this issue on the discord!", - e - ).printStackTrace() - if (command) { - ChatUtils.error("An error occurred while trying to reload the repo! See logs for more info.") - } + ErrorManager.logErrorWithData( + e, + "Failed to download SkyHanni Repo", + "url" to url, + "command" to command, + ) return@supplyAsync false } RepoUtils.unzipIgnoreFirstFolder( @@ -140,7 +144,11 @@ class RepoManager(private val configLocation: File) { } } } catch (e: Exception) { - e.printStackTrace() + ErrorManager.logErrorWithData( + e, + "Failed to download SkyHanni Repo", + "command" to command, + ) } true } diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt index 38a08f8d6..861e17c82 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data.repo +import at.hannibal2.skyhanni.test.command.ErrorManager import com.google.gson.Gson import java.io.BufferedReader import java.io.File @@ -65,7 +66,12 @@ object RepoUtils { zis.close() fis.close() } catch (e: IOException) { - e.printStackTrace() + ErrorManager.logErrorWithData( + e, + "unzipIgnoreFirstFolder failed", + "zipFilePath" to zipFilePath, + "destDir" to destDir, + ) } } |