-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Error Improvement} Adjust error types #15865
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
Changes from all commits
6453969
03bc1bb
b7398ed
f2b8815
9258ae4
500b150
682bea8
309a512
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,14 @@ def send_telemetry(self): | |
| telemetry.set_failure(self.error_msg) | ||
| if self.exception_trace: | ||
| telemetry.set_exception(self.exception_trace, '') | ||
|
|
||
|
|
||
| class UnknownError(AzCLIError): | ||
| """ Unclear errors, could not know who should be responsible for the errors. | ||
| DO NOT raise this error class in your codes. """ | ||
| def send_telemetry(self): | ||
| super().send_telemetry() | ||
| telemetry.set_failure(self.error_msg) | ||
| # endregion | ||
|
|
||
|
|
||
|
|
@@ -125,8 +133,8 @@ class InvalidArgumentValueError(UserFault): | |
| pass | ||
|
|
||
|
|
||
| class ArgumentParseError(UserFault): | ||
| """ Fallback of the argument parsing related errors. | ||
| class ArgumentUsageError(UserFault): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ArgumentParseError seems making more sense.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Want use this type to cover the original UsageError, which usually are the across arguement errors. |
||
| """ Fallback of the argument usage related errors. | ||
| Avoid using this class unless the error can not be classified | ||
| into the Argument related specific error types. """ | ||
| pass | ||
|
|
@@ -199,7 +207,7 @@ class ValidationError(UserFault): | |
| pass | ||
|
|
||
|
|
||
| class UnknownError(UserFault): | ||
| class UnclassifiedUserFault(UserFault): | ||
| """ Fallback of the UserFault related error types. | ||
| Avoid using this class unless the error can not be classified into | ||
| the UserFault related specific error types. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,8 +96,8 @@ def handle_exception(ex): # pylint: disable=too-many-locals, too-many-statement | |
| az_error = azclierror.ValidationError(error_msg) | ||
|
|
||
| elif isinstance(ex, CLIError): | ||
| # TODO: Fine-grained analysis here for Unknown error | ||
| az_error = azclierror.UnknownError(error_msg) | ||
| # TODO: Fine-grained analysis here | ||
| az_error = azclierror.UnclassifiedUserFault(error_msg) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why CLIError here is UserFault?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally, Temporarily count the CLIError here as UserFaults for better Telemetry analysis. Because we could know almost all of the CLIErrors are UserFaults though may not 100%. This is much better than counting CLIErrors as UnknownError. If so, a lot of userfaults are mis-categorized. |
||
|
|
||
| elif isinstance(ex, AzureError): | ||
| if extract_common_error_message(ex): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.