Skip to content

Commit

Permalink
Improve the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
aversey committed Dec 18, 2024
1 parent 04278fb commit 7bc2b26
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/hopsworks_common/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import importlib
import importlib.util
import logging
import os
import re
import sys
Expand Down Expand Up @@ -52,6 +53,9 @@
_hsfs_engine_type = None


_logger = logging.getLogger(__name__)


class Connection:
"""A hopsworks connection object.
Expand Down Expand Up @@ -434,11 +438,11 @@ def _provide_project(self, name=None):
# istio client, default resources,...
self._model_serving_api.load_default_configuration()
except RestAPIError as e:
if e.response.error_code == 403:
if e.response.error_code == 403 and e.error_code == 320004:
print(
"You lack permission to initialize model serving. Machine learning functionality will be not available."
'API key does not include "SERVING" scope, the related functionality will be disabled.'
)
print("The permission-related exception is:", e)
_logger.debug(f"The ignored exception: {e}")
else:
raise e

Expand Down

0 comments on commit 7bc2b26

Please sign in to comment.