pygeobox 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pygeobox/exception.py CHANGED
@@ -1,47 +1,47 @@
1
- class GeoboxError(Exception):
2
- """Base class for all exceptions raised by the Geobox SDK."""
3
- pass
4
-
5
- # Error Classes
6
- class AuthenticationError(GeoboxError):
7
- """Raised when there is an authentication error."""
8
-
9
- def __init__(self, message="Authentication failed"):
10
- self.message = message
11
- super().__init__(self.message)
12
-
13
- class AuthorizationError(GeoboxError):
14
- """Raised when there is an authorization error."""
15
-
16
- def __init__(self, message="Authorization failed"):
17
- self.message = message
18
- super().__init__(self.message)
19
-
20
- class ApiRequestError(GeoboxError):
21
- """Raised when there is an error with the API request."""
22
-
23
- def __init__(self, status_code, message="API request failed"):
24
- self.status_code = status_code
25
- self.message = f"{message}: Status code {status_code}"
26
- super().__init__(self.message)
27
-
28
- class NotFoundError(GeoboxError):
29
- """Raised when a requested resource is not found."""
30
-
31
- def __init__(self, message="Resource not found"):
32
- self.message = message
33
- super().__init__(self.message)
34
-
35
- class ValidationError(GeoboxError):
36
- """Raised when there is a validation error."""
37
-
38
- def __init__(self, message="Validation error"):
39
- self.message = message
40
- super().__init__(self.message)
41
-
42
- class ServerError(GeoboxError):
43
- """Raised when there is a server error."""
44
-
45
- def __init__(self, message="Server error"):
46
- self.message = message
47
- super().__init__(self.message)
1
+ class GeoboxError(Exception):
2
+ """Base class for all exceptions raised by the Geobox SDK."""
3
+ pass
4
+
5
+ # Error Classes
6
+ class AuthenticationError(GeoboxError):
7
+ """Raised when there is an authentication error."""
8
+
9
+ def __init__(self, message="Authentication failed"):
10
+ self.message = message
11
+ super().__init__(self.message)
12
+
13
+ class AuthorizationError(GeoboxError):
14
+ """Raised when there is an authorization error."""
15
+
16
+ def __init__(self, message="Authorization failed"):
17
+ self.message = message
18
+ super().__init__(self.message)
19
+
20
+ class ApiRequestError(GeoboxError):
21
+ """Raised when there is an error with the API request."""
22
+
23
+ def __init__(self, status_code, message="API request failed"):
24
+ self.status_code = status_code
25
+ self.message = f"{message}: Status code {status_code}"
26
+ super().__init__(self.message)
27
+
28
+ class NotFoundError(GeoboxError):
29
+ """Raised when a requested resource is not found."""
30
+
31
+ def __init__(self, message="Resource not found"):
32
+ self.message = message
33
+ super().__init__(self.message)
34
+
35
+ class ValidationError(GeoboxError):
36
+ """Raised when there is a validation error."""
37
+
38
+ def __init__(self, message="Validation error"):
39
+ self.message = message
40
+ super().__init__(self.message)
41
+
42
+ class ServerError(GeoboxError):
43
+ """Raised when there is a server error."""
44
+
45
+ def __init__(self, message="Server error"):
46
+ self.message = message
47
+ super().__init__(self.message)