-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbase_exceptions.py
More file actions
49 lines (38 loc) · 1.24 KB
/
base_exceptions.py
File metadata and controls
49 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
Base exceptions for errors returned by Vuforia Web Services or the
Vuforia
Cloud Recognition Web API.
"""
from beartype import beartype
from vws.response import Response
@beartype
class CloudRecoError(Exception):
"""Base class for Vuforia Cloud Recognition Web API exceptions."""
def __init__(self, response: Response) -> None:
"""
Args:
response: The response to a request to Vuforia.
"""
super().__init__(response.text)
self._response = response
@property
def response(self) -> Response:
"""The response returned by Vuforia which included this error."""
return self._response
@beartype
class VWSError(Exception):
"""Base class for Vuforia Web Services errors.
These errors are defined at
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-api#result-codes.
"""
def __init__(self, response: Response) -> None:
"""
Args:
response: The response to a request to Vuforia.
"""
super().__init__()
self._response = response
@property
def response(self) -> Response:
"""The response returned by Vuforia which included this error."""
return self._response