fix: Improve error message formatting in download functions

This commit is contained in:
ProtoTess
2025-11-18 17:49:13 +00:00
parent e0b484436d
commit b0dc7f6f60
+3 -3
View File
@@ -278,7 +278,7 @@ func (c *Client) downloadWithBasicAuth(ctx context.Context, downloadURL string)
errorMsg += fmt.Sprintf("\n 📝 Response: %s", bodyStr)
}
return nil, fmt.Errorf(errorMsg)
return nil, fmt.Errorf("%s", errorMsg)
}
data, err := io.ReadAll(resp.Body)
@@ -354,10 +354,10 @@ func (c *Client) downloadWithDigestAuth(ctx context.Context, downloadURL string)
}
if bodyStr != "" {
errorMsg += fmt.Sprintf("\n Response: %s", bodyStr)
errorMsg += fmt.Sprintf("\n 📝 Response: %s", bodyStr)
}
return nil, fmt.Errorf(errorMsg)
return nil, fmt.Errorf("%s", errorMsg)
}
data, err := io.ReadAll(resp.Body)