-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Core} az login: Capture managed_by_tenants error #15550
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ed808cf
wrap managed_by_tenants error
jiasli e1a4145
add example
jiasli 4952a9a
Update src/azure-cli-core/azure/cli/core/_profile.py
jiasli b729ef5
Update src/azure-cli-core/azure/cli/core/_profile.py
jiasli 3145198
Use CLIError
jiasli e0dbfe3
Merge branch 'dev' into login-stack
jiasli a15831f
Update link
jiasli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define an error sub-class may be InvalidProfileError(UserFault) and raise the specific error? UserFault is designed as an abstract class and is not recommended to be raised directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only a temporary mitigation to the service bug, it should actually be an
Unsupported API versionerror.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houk-ms , you can use
ABCandabstractmethod(from abc import ABC, abstractmethod) to define your class and make the parent class can't be instantiated.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arrownj sure, we can do that. Maybe in next CLI release
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiasli In this case, cosider using
from azure.cli.core.azclierror import UnknownErrorto replace UserFault if you don't define a new error typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use
CLIErrorfor now until the error can be classified asUnsupportedAPIErrorafter the service is fixed.