Skip to content

Commit

Permalink
Improvement: Better bz errors (#2681)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
hannibal002 and hannibal002 authored Oct 6, 2024
1 parent 1e786d9 commit cbaae60
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
)
}
}
}

Expand Down

0 comments on commit cbaae60

Please sign in to comment.