throw proper error when download of apks fail

This commit is contained in:
Michael Pöhn 2017-04-20 17:48:38 +02:00
parent c7ae6bc826
commit abe04272b1
3 changed files with 12 additions and 3 deletions

View file

@ -27,6 +27,7 @@ import tarfile
import traceback
import time
import json
import requests
from configparser import ConfigParser
from argparse import ArgumentParser
import logging
@ -1212,7 +1213,10 @@ def main():
logging.info("...retrieving " + url)
of = "{0}_{1}.apk.binary".format(app.id, build.versionCode)
of = os.path.join(output_dir, of)
net.download_file(url, local_filename=of)
try:
net.download_file(url, local_filename=of)
except requests.exceptions.HTTPError as e:
raise FDroidException('downloading Binaries from %s failed' % url) from e
build_succeeded.append(app)
wikilog = "Build succeeded"