aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt6
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
)
}
}