Skip to content

Commit 55336e3

Browse files
committed
CloudRecoService now raises now exceptions from vws.exceptions.vws_exceptions
1 parent 8457c74 commit 55336e3

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

src/vws/exceptions/cloud_reco_exceptions.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,24 @@ class InactiveProject(CloudRecoException):
2525
Exception raised when Vuforia returns a response with a result code
2626
'InactiveProject'.
2727
"""
28+
29+
30+
class BadImage(CloudRecoException):
31+
"""
32+
Exception raised when Vuforia returns a response with a result code
33+
'BadImage'.
34+
"""
35+
36+
37+
class AuthenticationFailure(CloudRecoException):
38+
"""
39+
Exception raised when Vuforia returns a response with a result code
40+
'AuthenticationFailure'.
41+
"""
42+
43+
44+
class RequestTimeTooSkewed(CloudRecoException):
45+
"""
46+
Exception raised when Vuforia returns a response with a result code
47+
'RequestTimeTooSkewed'.
48+
"""

src/vws/query.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
InactiveProject,
1616
MatchProcessing,
1717
MaxNumResultsOutOfRange,
18-
)
19-
from vws.exceptions.custom_exceptions import (
20-
ConnectionErrorPossiblyImageTooLarge,
21-
)
22-
from vws.exceptions.vws_exceptions import (
2318
AuthenticationFailure,
2419
BadImage,
2520
RequestTimeTooSkewed,
2621
)
22+
from vws.exceptions.custom_exceptions import (
23+
ConnectionErrorPossiblyImageTooLarge,
24+
)
2725
from vws.include_target_data import CloudRecoIncludeTargetData
2826
from vws.reports import QueryResult, TargetData
2927

@@ -74,8 +72,8 @@ def query(
7472
none (return no target_data), all (for all matched targets).
7573
7674
Raises:
77-
~vws.exceptions.vws_exceptions.AuthenticationFailure: The client
78-
access key pair is not correct.
75+
~vws.exceptions.cloud_reco_exceptions.AuthenticationFailure: The
76+
client access key pair is not correct.
7977
~vws.exceptions.cloud_reco_exceptions.MaxNumResultsOutOfRange:
8078
``max_num_results`` is not within the range (1, 50).
8179
~vws.exceptions.cloud_reco_exceptions.MatchProcessing: The given
@@ -85,11 +83,11 @@ def query(
8583
is inactive.
8684
~vws.exceptions.custom_exceptions.ConnectionErrorPossiblyImageTooLarge:
8785
The given image is too large.
88-
~vws.exceptions.vws_exceptions.RequestTimeTooSkewed: There is an
89-
error with the time sent to Vuforia.
90-
~vws.exceptions.vws_exceptions.BadImage: There is a problem with
91-
the given image. For example, it must be a JPEG or PNG file in
92-
the grayscale or RGB color space.
86+
~vws.exceptions.cloud_reco_exceptions.RequestTimeTooSkewed: There
87+
is an error with the time sent to Vuforia.
88+
~vws.exceptions.cloud_reco_exceptions.BadImage: There is a problem
89+
with the given image. For example, it must be a JPEG or PNG
90+
file in the grayscale or RGB color space.
9391
9492
Returns:
9593
An ordered list of target details of matching targets.

0 commit comments

Comments
 (0)