[depot_tools] Raise GS check_call err

Raise exception returned by GS when downloading

Bug: b/336509491
Change-Id: Iacd47f83cda07dcb55f9e904a606048cb844aedd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5484130
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
changes/30/5484130/3
Stephanie Kim 2 years ago committed by LUCI CQ
parent 5a0631fd9d
commit fb94001f06

@ -2694,7 +2694,9 @@ class GcsDependency(Dependency):
else:
gsutil = download_from_google_storage.Gsutil(
download_from_google_storage.GSUTIL_DEFAULT_PATH)
gsutil.check_call('cp', self.url, output_file)
code, _, err = gsutil.check_call('cp', self.url, output_file)
if code and err:
raise Exception(f'{code}: {err}')
# Check that something actually downloaded into the path
if not os.path.exists(output_file):
raise Exception(f'Nothing was downloaded into {output_file}')

Loading…
Cancel
Save