mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2026-02-04 10:14:15 +02:00
Minor refactoring - Separate exception from the parsing logic. Expect Discord API to always return JSON payload with all keys on Ratelimit
This commit is contained in:
@@ -173,7 +173,7 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
||||
if response.status_code == 401:
|
||||
raise exceptions.Unauthorized()
|
||||
if response.status_code == 429:
|
||||
raise exceptions.RateLimited(response)
|
||||
raise exceptions.RateLimited(response.json(), response.headers)
|
||||
|
||||
try:
|
||||
return response.json()
|
||||
|
||||
Reference in New Issue
Block a user