-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Core} Define new error types #15319
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
Conversation
|
Another problem in exception_handler: We are extracting error messages from the response instead of the error's formatted error_msg for AzureError, CloudError and HttpResponseError. Pro is we can show more useful info from response, con is hard to maintain and have to deal with all knids of |
| # region: Second Layer | ||
| # Main categories of the AzureCLI error types, used for Telemetry alalysis | ||
| # DO NOT raise the error classes here directly in your codes. | ||
| class UserFault(AzCLIError): |
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.
good point from @qwordy . how about _UserFault with _ prefix to hint user not to use those?
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.
We can use Abstract Base Classes.
https://docs.python.org/3/library/abc.html
https://www.python.org/dev/peps/pep-3119/
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.
I don't it is revolved. Reopen the conversation.
Description
This PR provides
Base class:
AzCLIErrorMain-categories:
UserFault,ClientError,ServiceErrorSub-categories: