Skip to content

Commit 1cf4459

Browse files
committed
Represent TooManyRequests error
1 parent 123af6d commit 1cf4459

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
},
66
"editor.defaultFormatter": "charliermarsh.ruff",
77
"editor.formatOnSave": true
8-
}
8+
},
9+
"esbonio.sphinx.confDir": ""
910
}

spelling_private_dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TargetProcessingTimeout
1919
TargetQuotaReached
2020
TargetStatusNotSuccess
2121
TargetStatusProcessing
22+
TooManyRequests
2223
Ubuntu
2324
UnknownTarget
2425
UnknownVWSErrorPossiblyBadName

src/vws/exceptions/vws_exceptions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ class RequestQuotaReached(VWSException): # pragma: no cover
5656
"""
5757

5858

59+
class TooManyRequests(VWSException): # pragma: no cover
60+
"""
61+
Exception raised when Vuforia returns a response with a result code
62+
'TooManyRequests'.
63+
"""
64+
65+
5966
class TargetStatusProcessing(VWSException):
6067
"""
6168
Exception raised when Vuforia returns a response with a result code

src/vws/vws.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
TargetQuotaReached,
3636
TargetStatusNotSuccess,
3737
TargetStatusProcessing,
38+
TooManyRequests,
3839
UnknownTarget,
3940
)
4041
from vws.reports import (
@@ -201,6 +202,7 @@ def _make_request(
201202
"TargetQuotaReached": TargetQuotaReached,
202203
"TargetStatusNotSuccess": TargetStatusNotSuccess,
203204
"TargetStatusProcessing": TargetStatusProcessing,
205+
"TooManyRequests": TooManyRequests,
204206
"UnknownTarget": UnknownTarget,
205207
}[result_code]
206208

0 commit comments

Comments
 (0)