dnf-json: fix depsolve error handling
When a DepsolveError exception occurs, the error message would print the packages in the request. When the request arguments changed, the error message handling wasn't updated and would fail to produce the correct error message. Compile a list of packages from all transactions and print them in the error message as a comma-separated list.
This commit is contained in:
parent
be2195b235
commit
d59d870574
1 changed files with 5 additions and 1 deletions
6
dnf-json
6
dnf-json
|
|
@ -212,9 +212,13 @@ def solve(request, cache_dir):
|
|||
}
|
||||
except dnf.exceptions.DepsolveError as e:
|
||||
printe("error depsolve")
|
||||
# collect list of packages for error
|
||||
pkgs = []
|
||||
for t in transactions:
|
||||
pkgs.extend(t["package-specs"])
|
||||
return None, {
|
||||
"kind": "DepsolveError",
|
||||
"reason": f"There was a problem depsolving {arguments['package-specs']}: {e}"
|
||||
"reason": f"There was a problem depsolving {', '.join(pkgs)}: {e}"
|
||||
}
|
||||
except dnf.exceptions.RepoError as e:
|
||||
return None, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue