etcdhttp: use EcodePrevValueRequired when appropriate
parent
5da481213e
commit
ab69c2adbd
|
@ -342,7 +342,7 @@ func parseKeyRequest(r *http.Request, id uint64, clock clockwork.Clock) (etcdser
|
|||
pV := r.FormValue("prevValue")
|
||||
if _, ok := r.Form["prevValue"]; ok && pV == "" {
|
||||
return emptyReq, etcdErr.NewRequestError(
|
||||
etcdErr.EcodeInvalidField,
|
||||
etcdErr.EcodePrevValueRequired,
|
||||
`"prevValue" cannot be empty`,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ func TestBadParseRequest(t *testing.T) {
|
|||
// prevValue cannot be empty
|
||||
{
|
||||
mustNewForm(t, "foo", url.Values{"prevValue": []string{""}}),
|
||||
etcdErr.EcodeInvalidField,
|
||||
etcdErr.EcodePrevValueRequired,
|
||||
},
|
||||
// wait is only valid with GET requests
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue