Skip to content

Commit

Permalink
improved the logs for better debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rotarur committed Jun 25, 2024
1 parent 02172a0 commit df7144e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit df7144e

Please sign in to comment.