diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-06 19:03:57 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-06 19:03:57 +0200 |
commit | b8981541f20e3abaf94fa313abdf40a5f5769b86 (patch) | |
tree | 8fc52cdce2392b8ce7fb96d7d70bdbeafdfe7515 /src/main/java | |
parent | 87d192e8933281bb39f425b9f373c47b23a0e110 (diff) | |
download | skyhanni-b8981541f20e3abaf94fa313abdf40a5f5769b86.tar.gz skyhanni-b8981541f20e3abaf94fa313abdf40a5f5769b86.tar.bz2 skyhanni-b8981541f20e3abaf94fa313abdf40a5f5769b86.zip |
more bazaar data on error
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 6 |
1 files changed, 4 insertions, 2 deletions
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 ) } } |