{Core} Print traceback to debug log when handle_exception is called#14588
{Core} Print traceback to debug log when handle_exception is called#14588
Conversation
There was a problem hiding this comment.
Capture requests.exceptions.SSLError which is generated by directly calling requests's methods.
There was a problem hiding this comment.
Will msrest capture SSLError?
|
Core |
There was a problem hiding this comment.
We still lack a good way to manage short links. Perhaps we need a meeting to discuss about how to manage them.
There was a problem hiding this comment.
Is there any security concern to expose the whole traceback to users?
Usually we can store trackback in our telemetry, but just show meaningful messages to users.
There was a problem hiding this comment.
- The traceback contains no sensitive information, but only the code flow. The value of parameters are not displayed.
- The traceback only appears in the
--debuglog and is not sent anywhere. If the user wants to share it, he/she can filter it first. - On the contrary, using client telemetry would expose more security concern as the traceback is sent over the network if telemetry is turned on.
- Using client telemetry would require us to identify the specific command execution from other millions of command executions.
- Anyway, the client telemetry doesn't support sending debug log right now.
|
|
||
| logger.debug("azure.cli.core.util.handle_exception is called with an exception:") | ||
| # Print the traceback and exception message | ||
| logger.debug(traceback.format_exc()) |
There was a problem hiding this comment.
Can you make sure the trace is of ex? ex is not used.
There was a problem hiding this comment.
format_exc prints the last exception (represented by sys.exc_info()), and when handle_exception is called, sys.exc_info() corresponds to ex.

Description
Print traceback to debug log when
azure.cli.core.util.handle_exceptionis called. This can help identify where the exception is generated and thrown.Testing Guide
Notice the location
westuis wrong (should bewestus):