onedrive: Don't mask HTTP error codes with JSON decode error

This commit is contained in:
Nick Craig-Wood 2015-12-28 15:10:21 +00:00
parent e69e181090
commit 05dc7183cb

View File

@ -158,7 +158,7 @@ func errorHandler(resp *http.Response) error {
errResponse := new(api.Error)
err := rest.DecodeJSON(resp, &errResponse)
if err != nil {
return err
fs.Debug(nil, "Couldn't decode error response: %v", err)
}
if errResponse.ErrorInfo.Code == "" {
errResponse.ErrorInfo.Code = resp.Status