Skip to content

Commit 145d3c8

Browse files
committed
docs: Fix typehint for ratelimit dict.
Also add back the response on error.
1 parent 9568b6a commit 145d3c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

interactions/api/http.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Request:
134134
135135
:ivar str token: The current application token.
136136
:ivar AbstractEventLoop _loop: The current coroutine event loop.
137-
:ivar Dict[Route, Limiter] ratelimits: The current per-route rate limiters from the API.
137+
:ivar Dict[str, Limiter] ratelimits: The current per-route rate limiters from the API.
138138
:ivar dict _headers: The current headers for an HTTP request.
139139
:ivar ClientSession _session: The current session for making requests.
140140
:ivar Limiter _global_lock: The global rate limiter.
@@ -247,6 +247,11 @@ async def request(self, route: Route, **kwargs) -> Optional[Any]:
247247
bucket.hashes.append(_bucket)
248248

249249
if isinstance(data, dict) and data.get("errors"):
250+
log.debug(
251+
f"RETURN {response.status}: {dumps(data, indent=4, sort_keys=True)}"
252+
)
253+
# This "redundant" debug line is for debug use and tracing back the error codes.
254+
250255
raise HTTPException(data["code"], message=data["message"])
251256
elif remaining and not int(remaining):
252257
if response.status == 429:

0 commit comments

Comments
 (0)