Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSTORE-1645] Catch HSML initialization permission-related errors in login #440

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aversey
Copy link
Contributor

@aversey aversey commented Dec 16, 2024

JIRA Issue: FSTORE-1645

@aversey aversey requested a review from vatj December 16, 2024 06:30
@aversey aversey self-assigned this Dec 16, 2024
except RestAPIError as e:
if e.response.error_code == 403:
print(
"You lack permission to initialize model serving. Machine learning functionality will be not available."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"You lack permission to initialize model serving. Machine learning functionality will be not available."
"Api key does not include "SERVING" scope, related functionality will be disabled."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message may be misleading, since the code catches all 403. I'll think about this and hopefully come up with a better solution.

print(
"You lack permission to initialize model serving. Machine learning functionality will be not available."
)
print("The permission-related exception is:", e)
Copy link
Contributor

@vatj vatj Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a debug/exception logger for the second print instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I printed it for the same reason as is explained above. I will change it to use the debug logger.

@aversey aversey requested a review from vatj December 18, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants