From cbaae605593df9ce1edf1675f0ef6d4e560fc6ff Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sun, 6 Oct 2024 16:30:33 +0200 Subject: Improvement: Better bz errors (#2681) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') 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 c1a7af289..7a97fca1d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt @@ -37,7 +37,7 @@ object HypixelBazaarFetcher { @SubscribeEvent fun onDebugDataCollect(event: DebugDataCollectEvent) { - event.title("Bazaar Fetching") + event.title("Bazaar Data Fetcher from API") val data = listOf( "failedAttempts: $failedAttempts", @@ -119,13 +119,20 @@ object HypixelBazaarFetcher { e.printStackTrace() } else { nextFetchTime = SimpleTimeMark.now() + 15.minutes - ErrorManager.logErrorWithData( - e, - userMessage, - "fetchType" to fetchType, - "failedAttempts" to failedAttempts, - "rawResponse" to rawResponse, - ) + if (rawResponse == null || rawResponse.toString() == "{}") { + ChatUtils.chat( + "§cFailed loading Bazaar Price data!\n" + + "Please wait until the Hypixel API is sending correct data again! There is nothing else to do at the moment.", + ) + } else { + ErrorManager.logErrorWithData( + e, + userMessage, + "fetchType" to fetchType, + "failedAttempts" to failedAttempts, + "rawResponse" to rawResponse, + ) + } } } -- cgit