Skip to content
This repository was archived by the owner on Jun 9, 2024. It is now read-only.

Commit c317244

Browse files
authored
Merge pull request #695 from nikammerlaan/add-retry-after-header-logging
Add logging for Retry-After header on 429
2 parents 43ed0c5 + bc34a96 commit c317244

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/mewna/catnip/rest/requester/AbstractRequester.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,12 @@ protected void handleResponse(@Nonnull final Route route, final int statusCode,
253253
if(statusCode == 429) {
254254
if(catnip.options().logLifecycleEvents()) {
255255
catnip.logAdapter().warn(
256-
"Hit 429! Route: {}, X-Ratelimit-Global: {}, X-Ratelimit-Limit: {}, X-Ratelimit-Reset: {}",
256+
"Hit 429! Route: {}, X-Ratelimit-Global: {}, X-Ratelimit-Limit: {}, X-Ratelimit-Reset: {}, Retry-After: {}",
257257
route.baseRoute(),
258258
headers.firstValue("X-Ratelimit-Global").orElse(null),
259259
headers.firstValue("X-Ratelimit-Limit").orElse(null),
260-
headers.firstValue("X-Ratelimit-Reset").orElse(null)
260+
headers.firstValue("X-Ratelimit-Reset").orElse(null),
261+
headers.firstValue("Retry-After").orElse(null)
261262
);
262263
}
263264
catnip.dispatchManager().dispatchEvent(Raw.REST_RATELIMIT_HIT,

0 commit comments

Comments
 (0)