mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: log incorrect HTTP resp body as string
This commit is contained in:
parent
ccca32b138
commit
e457d52f5c
@ -224,7 +224,7 @@ func assertResponse(got http.Request, wantURL *url.URL, wantHeader http.Header,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if wantBody == nil {
|
if wantBody == nil {
|
||||||
return fmt.Errorf("want.Body=%v got.Body=%v", wantBody, got.Body)
|
return fmt.Errorf("want.Body=%v got.Body=%s", wantBody, got.Body)
|
||||||
} else {
|
} else {
|
||||||
gotBytes, err := ioutil.ReadAll(got.Body)
|
gotBytes, err := ioutil.ReadAll(got.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -232,7 +232,7 @@ func assertResponse(got http.Request, wantURL *url.URL, wantHeader http.Header,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !reflect.DeepEqual(wantBody, gotBytes) {
|
if !reflect.DeepEqual(wantBody, gotBytes) {
|
||||||
return fmt.Errorf("want.Body=%v got.Body=%v", wantBody, gotBytes)
|
return fmt.Errorf("want.Body=%s got.Body=%s", wantBody, gotBytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user