From df7144ec02d7ef7a42aaf1e0a06a871a7394df5f Mon Sep 17 00:00:00 2001 From: Ruslan Rotaru Date: Tue, 25 Jun 2024 14:18:30 +0100 Subject: [PATCH] improved the logs for better debugging --- internal/utils/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/utils/utils.go b/internal/utils/utils.go index dc42a8f..5ea8e5b 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -57,7 +57,7 @@ func GetCID(url string, payload io.Reader) (*http.Response, error) { if dirIPFS.Message == DIR_ERROR { return nil, fmt.Errorf("cannot get this IPFS CID. Error message: %s", dirIPFS.Message) } else { - return nil, fmt.Errorf("there was an error with the request. Error code: HTTP %s", s) + return nil, fmt.Errorf("error making POST request to <%s>. Error code: HTTP %s", url, s) } } @@ -149,7 +149,7 @@ func PostCID(dst string, payload []byte, fPath string) (*http.Response, error) { } if s := res.Status; strings.HasPrefix(s, "5") || strings.HasPrefix(s, "4") { - return nil, fmt.Errorf("the endpoint responded with: HTTP %s", s) + return nil, fmt.Errorf("the endpoint responded with: HTTP %s, when executing POST request on <%s>", dst, s) } return res, nil