mirror of https://github.com/rclone/rclone.git
Update go-acd vendor to fix error message - fixes #860
This commit is contained in:
parent
687abe7803
commit
34e7ca90fc
|
@ -190,7 +190,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ncw/go-acd",
|
"ImportPath": "github.com/ncw/go-acd",
|
||||||
"Rev": "fafd639874ad90ef88345a48bd8aeffdbca6480f"
|
"Rev": "a3c3df8bf8c4a3b8c5c0e10ec88e914c68ffa977"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ncw/swift",
|
"ImportPath": "github.com/ncw/swift",
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -178,16 +179,15 @@ func CheckResponse(r *http.Response) error {
|
||||||
|
|
||||||
errBody := ""
|
errBody := ""
|
||||||
if data, err := ioutil.ReadAll(r.Body); err == nil {
|
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 == "" {
|
if errBody == "" {
|
||||||
errMsg += "no response body"
|
errMsg += "no response body"
|
||||||
} else {
|
} else {
|
||||||
errMsg += fmt.Sprintf("reponse body: %v", errBody)
|
errMsg += fmt.Sprintf("response body: %q", errBody)
|
||||||
}
|
}
|
||||||
errMsg += "\n"
|
|
||||||
|
|
||||||
return errors.New(errMsg)
|
return errors.New(errMsg)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue