From bcd5ab54190b5d64afb4b8baa4d5ca57da77e9b3 Mon Sep 17 00:00:00 2001 From: Katistix <33645731+Katistic@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:21:46 +1000 Subject: [PATCH] RateLimit error handling --- vrcpy/request.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vrcpy/request.py b/vrcpy/request.py index a0a8a76..cc9548b 100644 --- a/vrcpy/request.py +++ b/vrcpy/request.py @@ -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: