1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-16 00:04:40 +00:00

Update go-acd vendor to fix error message - fixes #860

This commit is contained in:
Nick Craig-Wood
2016-11-07 10:20:26 +00:00
parent 687abe7803
commit 34e7ca90fc
2 changed files with 5 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"
)
const (
@@ -178,16 +179,15 @@ func CheckResponse(r *http.Response) error {
errBody := ""
if data, err := ioutil.ReadAll(r.Body); err == nil {
errBody = string(data)
errBody = strings.TrimSpace(string(data))
}
errMsg := fmt.Sprintf("HTTP code %v: %q, ", c, r.Status)
errMsg := fmt.Sprintf("HTTP code %v: %q: ", c, r.Status)
if errBody == "" {
errMsg += "no response body"
} else {
errMsg += fmt.Sprintf("reponse body: %v", errBody)
errMsg += fmt.Sprintf("response body: %q", errBody)
}
errMsg += "\n"
return errors.New(errMsg)
}