File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 88import json
99import time
1010from datetime import date
11+ from http import HTTPStatus
1112from typing import TYPE_CHECKING , BinaryIO
1213from urllib .parse import urljoin
1314
@@ -181,6 +182,12 @@ def _make_request(
181182 if "Oops, an error occurred" in response .text :
182183 raise UnknownVWSErrorPossiblyBadName
183184
185+ if (
186+ response .status_code == HTTPStatus .TOO_MANY_REQUESTS
187+ ): # pragma: no cover
188+ # The Vuforia API returns a 429 response with no JSON body.
189+ raise TooManyRequests (response = response )
190+
184191 result_code = response .json ()["result_code" ]
185192
186193 if result_code == expected_result_code :
@@ -202,7 +209,6 @@ def _make_request(
202209 "TargetQuotaReached" : TargetQuotaReached ,
203210 "TargetStatusNotSuccess" : TargetStatusNotSuccess ,
204211 "TargetStatusProcessing" : TargetStatusProcessing ,
205- "TooManyRequests" : TooManyRequests ,
206212 "UnknownTarget" : UnknownTarget ,
207213 }[result_code ]
208214
You can’t perform that action at this time.
0 commit comments