dnf-json: Return an error when repo setup fails

This commit is contained in:
Brian C. Lane 2020-03-18 09:43:05 -07:00 committed by Tom Gundersen
parent 8d71773f7d
commit 8f8187061f

View file

@ -88,7 +88,10 @@ cachedir = arguments["cachedir"]
module_platform_id = arguments["module_platform_id"]
with tempfile.TemporaryDirectory() as persistdir:
base = create_base(repos, module_platform_id, persistdir, cachedir)
try:
base = create_base(repos, module_platform_id, persistdir, cachedir)
except dnf.exceptions.RepoError as e:
exit_with_dnf_error("RepoError", f"Error occurred when setting up repo: {e}")
if command == "dump":
packages = []