From a36e82866c6e36b35a9bd426eec9b50ba526a535 Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Wed, 12 Feb 2025 10:56:38 +0100 Subject: [PATCH] Print details when package installation fails --- internal/api/packages.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/packages.go b/internal/api/packages.go index 654d50c..531a512 100644 --- a/internal/api/packages.go +++ b/internal/api/packages.go @@ -184,12 +184,12 @@ func detailedInstallationError(response *http.Response) error { body, err := io.ReadAll(response.Body) // response body is []byte if err != nil { - return fmt.Errorf("the package could not be installed") + return fmt.Errorf("the package could not be installed, err=%q", err) } var result InstallationErrors if err := json.Unmarshal(body, &result); err != nil { - return fmt.Errorf("the package could not be installed and the reason returned could not be parsed") + return fmt.Errorf("the package could not be installed and the reason returned could not be parsed, err=%q response=%q", err, body) } allErrors := append(result.ParseErrors, result.InstallationErrors...)