Skip to content

Commit

Permalink
Fix detect issue for no code read permission (#842)
Browse files Browse the repository at this point in the history
* Fix detect issue for no code read permission

* Make debug to warning
  • Loading branch information
atbagga committed Nov 5, 2019
1 parent 5affa22 commit 2ed0e26
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion azure-devops/azext_devops/dev/common/vsts_git_url_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,16 @@ def get_vsts_info(remote_url):
else:
uri = remote_url
credentials = _get_credentials(uri)
return GitClient.get_vsts_info_by_remote_url(uri, credentials=credentials)
try:
return GitClient.get_vsts_info_by_remote_url(uri, credentials=credentials)
except Exception as ex: # pylint: disable=broad-except
exceptionTypeName = type(ex).__name__
if exceptionTypeName == 'AzureDevOpsAuthenticationError':
logger.warning('Auto-detect from git remote url failed because of insufficient permissions.')
return None
import sys
from six import reraise
reraise(*sys.exc_info())

@staticmethod
def convert_ssh_netloc_to_https_netloc(netloc):
Expand Down

0 comments on commit 2ed0e26

Please sign in to comment.