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

Commit bcd5ab5

Browse files
committed
RateLimit error handling
1 parent 533b79c commit bcd5ab5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vrcpy/request.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ def on_200():
8888
if "requiresTwoFactorAuth" in resp["data"]:
8989
raise ClientErrors.MfaRequired("Account login requires mfa")
9090

91+
def on_429():
92+
raise RequestErrors.RateLimit("You are being rate limited")
93+
9194
switch = {
92-
200: on_200
95+
200: on_200,
96+
429: on_429
9397
}
9498

9599
if resp["status"] in switch:

0 commit comments

Comments
 (0)