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

2
Godeps/Godeps.json generated
View file

@ -190,7 +190,7 @@
},
{
"ImportPath": "github.com/ncw/go-acd",
"Rev": "fafd639874ad90ef88345a48bd8aeffdbca6480f"
"Rev": "a3c3df8bf8c4a3b8c5c0e10ec88e914c68ffa977"
},
{
"ImportPath": "github.com/ncw/swift",

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)
}