Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/azure-cli-core/azure/cli/core/azclierror.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ def set_exception_trace(self, exception_trace):
def print_error(self):
from azure.cli.core.azlogging import CommandLoggerContext
with CommandLoggerContext(logger):
# print error type and error message
message = '{}: {}'.format(self.__class__.__name__, self.error_msg)
logger.error(message)
# print the error message
logger.error(self.error_msg)
# print exception trace if there is
if self.exception_trace:
logger.exception(self.exception_trace)
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def mock_add_extension(*args, **kwargs):
# assert the right type of error msg is logged for command vs argument parsing
self.assertEqual(len(logger_msgs), 5)
for msg in logger_msgs[:3]:
self.assertIn("CommandNotFoundError", msg)
self.assertIn("is misspelled or not recognized by the system", msg)
for msg in logger_msgs[3:]:
self.assertIn("not a valid value for '--opt'.", msg)

Expand Down