|
20 | 20 | OopsAnErrorOccurredPossiblyBadName,
|
21 | 21 | ServerError,
|
22 | 22 | TargetProcessingTimeout,
|
| 23 | + TooManyRequests, |
23 | 24 | )
|
24 | 25 | from vws.exceptions.vws_exceptions import (
|
25 | 26 | AuthenticationFailure,
|
|
37 | 38 | TargetQuotaReached,
|
38 | 39 | TargetStatusNotSuccess,
|
39 | 40 | TargetStatusProcessing,
|
40 |
| - TooManyRequests, |
41 | 41 | UnknownTarget,
|
42 | 42 | )
|
43 | 43 | from vws.reports import (
|
@@ -167,6 +167,10 @@ def _make_request(
|
167 | 167 | an HTML page with the text "Oops, an error occurred". This has
|
168 | 168 | been seen to happen when the given name includes a bad
|
169 | 169 | character.
|
| 170 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 171 | + with Vuforia's servers. |
| 172 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 173 | + limiting access. |
170 | 174 | json.decoder.JSONDecodeError: The server did not respond with valid
|
171 | 175 | JSON. This may happen if the server address is not a valid
|
172 | 176 | Vuforia server.
|
@@ -274,6 +278,10 @@ def add_target(
|
274 | 278 | Vuforia returns an HTML page with the text "Oops, an error
|
275 | 279 | occurred". This has been seen to happen when the given name
|
276 | 280 | includes a bad character.
|
| 281 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 282 | + with Vuforia's servers. |
| 283 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 284 | + limiting access. |
277 | 285 | """
|
278 | 286 | image_data = _get_image_data(image=image)
|
279 | 287 | image_data_encoded = base64.b64encode(image_data).decode("ascii")
|
@@ -320,6 +328,10 @@ def get_target_record(self, target_id: str) -> TargetStatusAndRecord:
|
320 | 328 | does not match a target in the database.
|
321 | 329 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
322 | 330 | error with the time sent to Vuforia.
|
| 331 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 332 | + with Vuforia's servers. |
| 333 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 334 | + limiting access. |
323 | 335 | """
|
324 | 336 | response = self._make_request(
|
325 | 337 | method="GET",
|
@@ -377,6 +389,10 @@ def wait_for_target_processed(
|
377 | 389 | does not match a target in the database.
|
378 | 390 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
379 | 391 | error with the time sent to Vuforia.
|
| 392 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 393 | + with Vuforia's servers. |
| 394 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 395 | + limiting access. |
380 | 396 | """
|
381 | 397 | start_time = time.monotonic()
|
382 | 398 | while True:
|
@@ -408,6 +424,10 @@ def list_targets(self) -> list[str]:
|
408 | 424 | known database.
|
409 | 425 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
410 | 426 | error with the time sent to Vuforia.
|
| 427 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 428 | + with Vuforia's servers. |
| 429 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 430 | + limiting access. |
411 | 431 | """
|
412 | 432 | response = self._make_request(
|
413 | 433 | method="GET",
|
@@ -441,6 +461,10 @@ def get_target_summary_report(self, target_id: str) -> TargetSummaryReport:
|
441 | 461 | does not match a target in the database.
|
442 | 462 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
443 | 463 | error with the time sent to Vuforia.
|
| 464 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 465 | + with Vuforia's servers. |
| 466 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 467 | + limiting access. |
444 | 468 | """
|
445 | 469 | response = self._make_request(
|
446 | 470 | method="GET",
|
@@ -480,6 +504,10 @@ def get_database_summary_report(self) -> DatabaseSummaryReport:
|
480 | 504 | known database.
|
481 | 505 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
482 | 506 | error with the time sent to Vuforia.
|
| 507 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 508 | + with Vuforia's servers. |
| 509 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 510 | + limiting access. |
483 | 511 | """
|
484 | 512 | response = self._make_request(
|
485 | 513 | method="GET",
|
@@ -526,6 +554,10 @@ def delete_target(self, target_id: str) -> None:
|
526 | 554 | target is in the processing state.
|
527 | 555 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
528 | 556 | error with the time sent to Vuforia.
|
| 557 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 558 | + with Vuforia's servers. |
| 559 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 560 | + limiting access. |
529 | 561 | """
|
530 | 562 | self._make_request(
|
531 | 563 | method="DELETE",
|
@@ -559,6 +591,10 @@ def get_duplicate_targets(self, target_id: str) -> list[str]:
|
559 | 591 | inactive.
|
560 | 592 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
561 | 593 | error with the time sent to Vuforia.
|
| 594 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 595 | + with Vuforia's servers. |
| 596 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 597 | + limiting access. |
562 | 598 | """
|
563 | 599 | response = self._make_request(
|
564 | 600 | method="GET",
|
@@ -618,6 +654,10 @@ def update_target(
|
618 | 654 | inactive.
|
619 | 655 | ~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
|
620 | 656 | error with the time sent to Vuforia.
|
| 657 | + ~vws.exceptions.custom_exceptions.ServerError: There is an error |
| 658 | + with Vuforia's servers. |
| 659 | + ~vws.exceptions.custom_exceptions.TooManyRequests: Vuforia is rate |
| 660 | + limiting access. |
621 | 661 | """
|
622 | 662 | data: dict[str, str | bool | float | int] = {}
|
623 | 663 |
|
|
0 commit comments