diff --git a/osbuild/solver/__init__.py b/osbuild/solver/__init__.py index 27b3c3e7..64fd2778 100755 --- a/osbuild/solver/__init__.py +++ b/osbuild/solver/__init__.py @@ -48,6 +48,10 @@ class DepsolveError(SolverException): pass +class InvalidRequestError(SolverException): + pass + + def modify_rootdir_path(path, root_dir): if path and root_dir: # if the root_dir is set, we need to translate the key path to be under this directory diff --git a/tools/osbuild-depsolve-dnf b/tools/osbuild-depsolve-dnf index 37f5c39f..98e4bf05 100755 --- a/tools/osbuild-depsolve-dnf +++ b/tools/osbuild-depsolve-dnf @@ -13,7 +13,7 @@ import os.path import sys import tempfile -from osbuild.solver import GPGKeyReadError, MarkingError, DepsolveError, RepoError +from osbuild.solver import GPGKeyReadError, MarkingError, DepsolveError, RepoError, InvalidRequestError # Load the solver configuration config = {"use_dnf5": False} @@ -92,6 +92,12 @@ def solve(request, cache_dir): "kind": "DepsolveError", "reason": f"There was a problem depsolving {', '.join(pkgs)}: {e}" } + except InvalidRequestError as e: + printe("error invalid request") + return None, { + "kind": "InvalidRequest", + "reason": str(e) + } except Exception as e: # pylint: disable=broad-exception-caught printe("error traceback") import traceback