build+drozer: error message instead of crash when repo-folder missing

This commit is contained in:
Michael Pöhn 2017-09-25 16:09:57 +02:00
parent ca069d941d
commit d8485f7123

View file

@ -1231,6 +1231,7 @@ def main():
logging.error("VCS error while building app %s: %s" % ( logging.error("VCS error while building app %s: %s" % (
appid, reason)) appid, reason))
if options.stop: if options.stop:
logging.debug("Error encoutered, stopping by user request.")
sys.exit(1) sys.exit(1)
failed_apps[appid] = vcse failed_apps[appid] = vcse
wikilog = str(vcse) wikilog = str(vcse)
@ -1245,6 +1246,7 @@ def main():
f.write(str(e)) f.write(str(e))
logging.error("Could not build app %s: %s" % (appid, e)) logging.error("Could not build app %s: %s" % (appid, e))
if options.stop: if options.stop:
logging.debug("Error encoutered, stopping by user request.")
sys.exit(1) sys.exit(1)
failed_apps[appid] = e failed_apps[appid] = e
wikilog = e.get_wikitext() wikilog = e.get_wikitext()
@ -1252,6 +1254,7 @@ def main():
logging.error("Could not build app %s due to unknown error: %s" % ( logging.error("Could not build app %s due to unknown error: %s" % (
appid, traceback.format_exc())) appid, traceback.format_exc()))
if options.stop: if options.stop:
logging.debug("Error encoutered, stopping by user request.")
sys.exit(1) sys.exit(1)
failed_apps[appid] = e failed_apps[appid] = e
wikilog = str(e) wikilog = str(e)
@ -1305,10 +1308,11 @@ def main():
break break
if not apk_path: if not apk_path:
raise Exception("No signed APK found at path: {0}".format(apk_path)) raise Exception("No signed APK found at path: {path}".format(path=apk_path))
if not os.path.isdir(repo_dir): if not os.path.isdir(repo_dir):
exit(1) logging.critical("directory does not exists '{path}'".format(path=repo_dir))
sys.exit(1)
logging.info("Performing Drozer scan on {0}.".format(app)) logging.info("Performing Drozer scan on {0}.".format(app))
docker.perform_drozer_scan(apk_path, app.id, repo_dir) docker.perform_drozer_scan(apk_path, app.id, repo_dir)