77import json
88from urllib .parse import urlparse
99
10+ from beartype import beartype
11+
1012from vws .exceptions .base_exceptions import VWSError
1113
1214
15+ @beartype
1316class UnknownTargetError (VWSError ):
1417 """
1518 Exception raised when Vuforia returns a response with a result code
@@ -27,20 +30,23 @@ def target_id(self) -> str:
2730 return path .split (sep = "/" , maxsplit = 2 )[- 1 ]
2831
2932
33+ @beartype
3034class FailError (VWSError ):
3135 """
3236 Exception raised when Vuforia returns a response with a result code
3337 'Fail'.
3438 """
3539
3640
41+ @beartype
3742class BadImageError (VWSError ):
3843 """
3944 Exception raised when Vuforia returns a response with a result code
4045 'BadImage'.
4146 """
4247
4348
49+ @beartype
4450class AuthenticationFailureError (VWSError ):
4551 """
4652 Exception raised when Vuforia returns a response with a result code
@@ -49,13 +55,15 @@ class AuthenticationFailureError(VWSError):
4955
5056
5157# See https://github.com/VWS-Python/vws-python/issues/822.
58+ @beartype
5259class RequestQuotaReachedError (VWSError ): # pragma: no cover
5360 """
5461 Exception raised when Vuforia returns a response with a result code
5562 'RequestQuotaReached'.
5663 """
5764
5865
66+ @beartype
5967class TargetStatusProcessingError (VWSError ):
6068 """
6169 Exception raised when Vuforia returns a response with a result code
@@ -74,6 +82,7 @@ def target_id(self) -> str:
7482
7583
7684# This is not simulated by the mock.
85+ @beartype
7786class DateRangeError (VWSError ): # pragma: no cover
7887 """
7988 Exception raised when Vuforia returns a response with a result code
@@ -82,6 +91,7 @@ class DateRangeError(VWSError): # pragma: no cover
8291
8392
8493# This is not simulated by the mock.
94+ @beartype
8595class TargetQuotaReachedError (VWSError ): # pragma: no cover
8696 """
8797 Exception raised when Vuforia returns a response with a result code
@@ -90,6 +100,7 @@ class TargetQuotaReachedError(VWSError): # pragma: no cover
90100
91101
92102# This is not simulated by the mock.
103+ @beartype
93104class ProjectSuspendedError (VWSError ): # pragma: no cover
94105 """
95106 Exception raised when Vuforia returns a response with a result code
@@ -98,34 +109,39 @@ class ProjectSuspendedError(VWSError): # pragma: no cover
98109
99110
100111# This is not simulated by the mock.
112+ @beartype
101113class ProjectHasNoAPIAccessError (VWSError ): # pragma: no cover
102114 """
103115 Exception raised when Vuforia returns a response with a result code
104116 'ProjectHasNoAPIAccess'.
105117 """
106118
107119
120+ @beartype
108121class ProjectInactiveError (VWSError ):
109122 """
110123 Exception raised when Vuforia returns a response with a result code
111124 'ProjectInactive'.
112125 """
113126
114127
128+ @beartype
115129class MetadataTooLargeError (VWSError ):
116130 """
117131 Exception raised when Vuforia returns a response with a result code
118132 'MetadataTooLarge'.
119133 """
120134
121135
136+ @beartype
122137class RequestTimeTooSkewedError (VWSError ):
123138 """
124139 Exception raised when Vuforia returns a response with a result code
125140 'RequestTimeTooSkewed'.
126141 """
127142
128143
144+ @beartype
129145class TargetNameExistError (VWSError ):
130146 """
131147 Exception raised when Vuforia returns a response with a result code
@@ -142,13 +158,15 @@ def target_name(self) -> str:
142158 return str (request_json ["name" ])
143159
144160
161+ @beartype
145162class ImageTooLargeError (VWSError ):
146163 """
147164 Exception raised when Vuforia returns a response with a result code
148165 'ImageTooLarge'.
149166 """
150167
151168
169+ @beartype
152170class TargetStatusNotSuccessError (VWSError ):
153171 """
154172 Exception raised when Vuforia returns a response with a result code
@@ -166,6 +184,7 @@ def target_id(self) -> str:
166184 return path .split (sep = "/" , maxsplit = 2 )[- 1 ]
167185
168186
187+ @beartype
169188class TooManyRequestsError (VWSError ): # pragma: no cover
170189 """
171190 Exception raised when Vuforia returns a response with a result code
0 commit comments