From b8981541f20e3abaf94fa313abdf40a5f5769b86 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 6 May 2024 19:03:57 +0200 Subject: more bazaar data on error --- .../java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt index 148fb633a..2cb70f857 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt @@ -50,7 +50,8 @@ object HypixelBazaarFetcher { latestProductInformation = process(response.products) failedAttempts = 0 } else { - onError(fetchType, Exception("success=false, cause=${response.cause}")) + val rawResponse = jsonResponse.toString() + onError(fetchType, Exception("success=false, cause=${response.cause}"), rawResponse) } } catch (e: Exception) { onError(fetchType, e) @@ -71,7 +72,7 @@ object HypixelBazaarFetcher { internalName to BazaarData(internalName.itemName, sellOfferPrice, insantBuyPrice, product) }.toMap() - private fun onError(fetchType: String, e: Exception) { + private fun onError(fetchType: String, e: Exception, rawResponse: String? = null) { val userMessage = "Failed fetching bazaar price data from hypixel" failedAttempts++ if (failedAttempts <= HIDDEN_FAILED_ATTEMPTS) { @@ -85,6 +86,7 @@ object HypixelBazaarFetcher { userMessage, "fetchType" to fetchType, "failedAttepmts" to failedAttempts, + "rawResponse" to rawResponse ) } } -- cgit