Commit 47fd5674 authored by Joanna Wang's avatar Joanna Wang Committed by LUCI CQ

Add debug logs during Clone process.

The try/except was added for one specific situation but the 'except' portion accepts a wide range of errors. This results in confusing logs and nothing clearly states what actually caused the error.

Bug: 1349905, 1350210
Change-Id: Ia86c71b0b77658992fca5d3de215e659ccd90d96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3810798
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent 437ec683
......@@ -644,7 +644,8 @@ class GitWrapper(SCMWrapper):
self._UpdateMirrorIfNotContains(mirror, options, rev_type, revision)
try:
self._Clone(revision, url, options)
except subprocess2.CalledProcessError:
except subprocess2.CalledProcessError as e:
logging.warning('Clone failed due to: %s', e)
self._DeleteOrMove(options.force)
self._Clone(revision, url, options)
if file_list is not None:
......@@ -1173,6 +1174,7 @@ class GitWrapper(SCMWrapper):
retry=True,
print_stdout=print_stdout,
filter_fn=filter_fn)
logging.debug('Cloned into temporary dir, moving to checkout_path')
gclient_utils.safe_makedirs(self.checkout_path)
gclient_utils.safe_rename(os.path.join(tmp_dir, '.git'),
os.path.join(self.checkout_path, '.git'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment