File tree Expand file tree Collapse file tree 6 files changed +35
-14
lines changed
Expand file tree Collapse file tree 6 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 1+ """
2+ Base exceptions for errors returned by Vuforia Web Services or the Vuforia
3+ Cloud Recognition Web API.
4+ """
5+
16from requests import Response
27
38
@@ -24,15 +29,18 @@ def response(self) -> Response:
2429
2530class VWSException (Exception ):
2631 """
27- Base class for Vuforia Web Service errors.
32+ Base class for Vuforia Web Services errors.
33+
34+ These errors are defined at
35+ https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API#How-To-Interperete-VWS-API-Result-Codes.
2836 """
2937
3038 def __init__ (self , response : Response ) -> None :
3139 """
3240 Args:
3341 response: The response to a request to Vuforia.
3442 """
35- super ().__init__ (response . text )
43+ super ().__init__ ()
3644 self ._response = response
3745
3846 @property
Original file line number Diff line number Diff line change 1+ """
2+ Exceptions which match errors raised by the Vuforia Cloud Recognition Web APIs.
3+ """
4+
5+
16from vws .exceptions .base_exceptions import CloudRecoException
27
38
Original file line number Diff line number Diff line change 1+ """
2+ Exceptions which do not map to errors at
3+ https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API#How-To-Interperete-VWS-API-Result-Codes
4+ or simple errors given by the cloud recognition service.
5+ """
6+
17import requests
28
39
Original file line number Diff line number Diff line change 1414from mock_vws .states import States
1515
1616from vws import VWS , CloudRecoService
17- from vws .exceptions import (
17+ from vws .exceptions .base_exceptions import CloudRecoException , VWSException
18+ from vws .exceptions .cloud_reco_exceptions import (
19+ MatchProcessing ,
20+ MaxNumResultsOutOfRange ,
21+ )
22+ from vws .exceptions .custom_exceptions import (
23+ ConnectionErrorPossiblyImageTooLarge ,
24+ TargetProcessingTimeout ,
25+ UnknownVWSErrorPossiblyBadName ,
26+ )
27+ from vws .exceptions .vws_exceptions import (
1828 AuthenticationFailure ,
1929 BadImage ,
20- CloudRecoException ,
21- ConnectionErrorPossiblyImageTooLarge ,
2230 DateRangeError ,
2331 Fail ,
2432 ImageTooLarge ,
25- MatchProcessing ,
26- MaxNumResultsOutOfRange ,
2733 MetadataTooLarge ,
2834 ProjectHasNoAPIAccess ,
2935 ProjectInactive ,
3036 ProjectSuspended ,
3137 RequestQuotaReached ,
3238 RequestTimeTooSkewed ,
3339 TargetNameExist ,
34- TargetProcessingTimeout ,
3540 TargetQuotaReached ,
3641 TargetStatusNotSuccess ,
3742 TargetStatusProcessing ,
3843 UnknownTarget ,
39- UnknownVWSErrorPossiblyBadName ,
40- VWSException ,
4144)
4245
4346
@@ -368,7 +371,6 @@ def test_vwsexception_inheritance() -> None:
368371 TargetStatusNotSuccess ,
369372 TargetStatusProcessing ,
370373 UnknownTarget ,
371- UnknownVWSErrorPossiblyBadName ,
372374 ]
373375 for subclass in subclasses :
374376 assert issubclass (subclass , VWSException )
Original file line number Diff line number Diff line change 1010from mock_vws .database import VuforiaDatabase
1111
1212from vws import VWS , CloudRecoService
13- from vws .exceptions import (
13+ from vws .exceptions .cloud_reco_exceptions import MaxNumResultsOutOfRange
14+ from vws .exceptions .custom_exceptions import (
1415 ConnectionErrorPossiblyImageTooLarge ,
15- MaxNumResultsOutOfRange ,
1616)
1717from vws .include_target_data import CloudRecoIncludeTargetData
1818
Original file line number Diff line number Diff line change 1515from mock_vws .database import VuforiaDatabase
1616
1717from vws import VWS , CloudRecoService
18- from vws .exceptions import TargetProcessingTimeout
18+ from vws .exceptions . custom_exceptions import TargetProcessingTimeout
1919from vws .reports import (
2020 DatabaseSummaryReport ,
2121 TargetRecord ,
You can’t perform that action at this time.
0 commit comments