diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt index e1763f7d5..6b4bb40f6 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.test.command.CopyErrorCommand import com.google.gson.JsonObject import com.google.gson.JsonParser import com.google.gson.JsonSyntaxException @@ -59,10 +60,7 @@ object APIUtil { e.printStackTrace() } else { - println("JsonSyntaxException at getJSONResponse '$urlString'") - LorenzUtils.error("[SkyHanni] JsonSyntaxException at getJSONResponse!") - println("result: '$retSrc'") - e.printStackTrace() + CopyErrorCommand.logError(Error("Hypixel API error for url: '$urlString'", e), "Failed to load data from Hypixel API") } } } @@ -71,8 +69,7 @@ object APIUtil { if (silentError) { throw throwable } else { - throwable.printStackTrace() - LorenzUtils.error("SkyHanni ran into an ${throwable::class.simpleName ?: "error"} whilst fetching a resource. See logs for more details.") + CopyErrorCommand.logError(Error("Hypixel API error for url: '$urlString'", throwable), "Failed to load data from Hypixel API") } } finally { client.close() |