diff --git a/truss/remote/baseten/api.py b/truss/remote/baseten/api.py index e071a43a7..39be9de67 100644 --- a/truss/remote/baseten/api.py +++ b/truss/remote/baseten/api.py @@ -38,7 +38,7 @@ def _post_graphql_query(self, query_string: str) -> dict: resp_dict = resp.json() errors = resp_dict.get("errors") if errors: - raise ApiError(errors[0]["message"], resp) + raise ApiError(errors[0]["message"]) return resp_dict def model_s3_upload_credentials(self): diff --git a/truss/remote/baseten/error.py b/truss/remote/baseten/error.py index b7702133e..d0aff7ee7 100644 --- a/truss/remote/baseten/error.py +++ b/truss/remote/baseten/error.py @@ -1,6 +1,3 @@ -import json - - class Error(Exception): """Base Baseten Error""" @@ -12,21 +9,7 @@ def __init__(self, message): class ApiError(Error): """Errors in calling the Baseten API.""" - def __init__(self, message, response=None): - super().__init__(message) - self.response = response - - def __str__(self): - error_str = self.message - if ( - self.response is not None - ): # non-200 Response objects are falsy, hence the not None. - error_message = json.loads(self.response.content) - error_message = ( - error_message["error"] if "error" in error_message else error_message - ) - error_str = f"{error_str}\n" - return error_str + pass class AuthorizationError(Error):