diff --git a/exoscale/api/exceptions.py b/exoscale/api/exceptions.py index ee98ef0..2d90cf2 100644 --- a/exoscale/api/exceptions.py +++ b/exoscale/api/exceptions.py @@ -1,22 +1,28 @@ # exceptions.py + class ExoscaleAPIException(Exception): """ Base exception for exoscale API errors. Base for all other exception classes, it allows to catch all exoscale exceptions with a single except block. """ + pass + class ExoscaleAPIClientException(ExoscaleAPIException): """ For client-side errors (4xx). Shows that the client sent a bad request. """ + pass + class ExoscaleAPIServerException(ExoscaleAPIException): """ For server-side errors (5xx). Shows the server encountered an error while processing the request. """ + pass diff --git a/exoscale/api/v2.py b/exoscale/api/v2.py index 1ba25eb..2bab091 100644 --- a/exoscale/api/v2.py +++ b/exoscale/api/v2.py @@ -167,7 +167,6 @@ def _call_operation(self, operation_id, parameters=None, body=None): f"Server error {response.status_code}: {response.text}" ) - return response.json()