Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
RateLimit error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Katistic committed Aug 17, 2021
1 parent 533b79c commit bcd5ab5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vrcpy/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ def on_200():
if "requiresTwoFactorAuth" in resp["data"]:
raise ClientErrors.MfaRequired("Account login requires mfa")

def on_429():
raise RequestErrors.RateLimit("You are being rate limited")

switch = {
200: on_200
200: on_200,
429: on_429
}

if resp["status"] in switch:
Expand Down

0 comments on commit bcd5ab5

Please sign in to comment.