Skip to content

Commit 21c4a9a

Browse files
handle AzureDevOpsAuthenticationError and raise CLIError for the same (#769)
1 parent 519df0e commit 21c4a9a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

azure-devops/azext_devops/dev/common/exception_handler.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
def azure_devops_exception_handler(ex):
1313
# we are taking dependency on string here because taking dependency on
1414
# Azure DevOps Client will increase load time for every command
15-
if type(ex).__name__ == 'AzureDevOpsServiceError':
15+
exceptionTypeName = type(ex).__name__
16+
if exceptionTypeName == 'AzureDevOpsServiceError':
1617
logger.debug('handling vsts service error')
1718
raise CLIError(ex)
1819

19-
if type(ex).__name__ == 'ValueError':
20+
if exceptionTypeName == 'AzureDevOpsAuthenticationError':
21+
logger.debug('handling vsts auth error')
22+
raise CLIError(ex)
23+
24+
if exceptionTypeName == 'ValueError':
2025
logger.debug('handling value error')
2126
raise CLIError(ex)
2227

0 commit comments

Comments
 (0)