Bug 1407163: raise exceptions with HTTP error info; r?glandium
MozReview-Commit-ID: B3MvsZDpj9a
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1284,29 +1284,29 @@ class PackageFrontend(MachCommandBase):
if self.size is None and self.digest is None:
return True
return super(DownloadRecord, self).validate()
class ArtifactRecord(DownloadRecord):
def __init__(self, task_id, artifact_name):
cot = cache._download_manager.session.get(
get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
+ cot.raise_for_status()
digest = algorithm = None
- if cot.status_code == 200:
- # The file is GPG-signed, but we don't care about validating
- # that. Instead of parsing the PGP signature, we just take
- # the one line we're interested in, which starts with a `{`.
- data = {}
- for l in cot.content.splitlines():
- if l.startswith('{'):
- try:
- data = json.loads(l)
- break
- except Exception:
- pass
+ data = {}
+ # The file is GPG-signed, but we don't care about validating
+ # that. Instead of parsing the PGP signature, we just take
+ # the one line we're interested in, which starts with a `{`.
+ for l in cot.content.splitlines():
+ if l.startswith('{'):
+ try:
+ data = json.loads(l)
+ break
+ except Exception:
+ pass
for algorithm, digest in (data.get('artifacts', {})
.get(artifact_name, {}).items()):
pass
name = os.path.basename(artifact_name)
artifact_url = get_artifact_url(task_id, artifact_name,
use_proxy=not artifact_name.startswith('public/'))
super(ArtifactRecord, self).__init__(