Skip to content

AzCLIError should take kwarg original_exception #16348

Description

@jiasli

Is your feature request related to a problem? Please describe.

When an exception is caught and wrapped by AzCLIError, the analysis of the root cause of the exception may not be correct, thus the recommendation can also be misleading.

For example, #15776 assumes InvalidURL is caused by invalid AAD endpoint in cloud registration, but the exception is actually caused by invalid proxy URL. This PR is later reverted by #15962.

In the current design, the original exception is discarded and it is very difficult to identify what the original issue is.

Describe the solution you'd like

AzCLIError should take optional kwarg original_exception=None and when any exception is wrapped/replaced by AzCLIError, original_exception should be set as the original exception so that azure.cli.core.util.handle_exception can log callstack and error message of original_exception to

  • --debug log
  • telemetry (if allowed)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions