mdmcert: display reason in body output error

This commit is contained in:
Jesse Peterson
2025-01-16 23:36:44 -08:00
parent c6ae057c40
commit 90831d0c4b

View File

@@ -275,12 +275,13 @@ func sendMdmcertDownloadRequest(client *http.Client, req *http.Request) error {
}
var jsn = struct {
Result string
Reason string
}{}
if err := json.NewDecoder(resp.Body).Decode(&jsn); err != nil {
return err
}
if jsn.Result != "success" {
return fmt.Errorf("got unexpected result body: %q", jsn.Result)
return fmt.Errorf("got unexpected result body: %q (%q)", jsn.Result, jsn.Reason)
}
return nil
}