jobqueue: Move jobqueue out of internal

This commit is contained in:
Sanne Raymaekers 2022-06-10 11:32:40 +02:00 committed by Achilleas Koutsou
parent d9bd19404d
commit 03b57f002c
21 changed files with 28 additions and 19 deletions

View file

@ -442,6 +442,17 @@ func parseError(data []byte, repos []repoConfig) Error {
return e
}
func ParseError(data []byte) Error {
var e Error
if err := json.Unmarshal(data, &e); err != nil {
// dumping the error into the Reason can get noisy, but it's good for troubleshooting
return Error{
Kind: "InternalError",
Reason: fmt.Sprintf("Failed to unmarshal dnf-json error output %q: %s", string(data), err.Error()),
}
}
return e
}
func run(dnfJsonCmd []string, req *Request) ([]byte, error) {
if len(dnfJsonCmd) == 0 {