Skip to content

Commit 58ad9e3

Browse files
refactor: change condition for getting error message (#973)
* refactor: change condition for getting error message * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 82ee6ce commit 58ad9e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interactions/api/http/request.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ async def request(self, route: Route, **kwargs) -> Optional[Any]:
163163
self.buckets[route.endpoint] = _bucket
164164
# real-time replacement/update/add if needed.
165165
if isinstance(data, dict) and (
166-
data.get("errors") or (data.get("code") and data.get("code") != 429)
166+
data.get("errors")
167+
or ((code := data.get("code")) and code != 429 and data.get("message"))
167168
):
168169
log.debug(
169170
f"RETURN {response.status}: {dumps(data, indent=4, sort_keys=True)}"

0 commit comments

Comments
 (0)