Skip to content

Commit

Permalink
releaseb better response tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammers21 committed Jan 8, 2024
1 parent 3bec58f commit 34f1d50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/io/github/sammers/pla/blizzard/BlizzardAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ Maybe<JsonObject> maybeResponse(String namespace, String url) {
.addQueryParam("locale", LOCALE)
.bearerTokenAuthentication(blizzardAuthToken.accessToken())
.rxSend()
.timeout(10, TimeUnit.MINUTES)
.onErrorResumeNext(er -> {
log.error("Error getting " + url, er);
return Single.error(er);
})
.flatMapMaybe(resp -> {
log.info("Got response to" + url+ " " + resp.statusCode());
if (resp.statusCode() == 200) {
return Maybe.just(resp.bodyAsJsonObject());
} else if (resp.statusCode() == 429 || resp.statusCode() / 100 == 5) {
Expand Down

0 comments on commit 34f1d50

Please sign in to comment.