mirror of https://github.com/status-im/consul.git
add err msg on PeeringRead not found (#12986)
Signed-off-by: FFMMM <FFMMM@users.noreply.github.com> Co-authored-by: Freddy <freddygv@users.noreply.github.com>
This commit is contained in:
parent
37a1e33834
commit
b8ce8e36fb
|
@ -48,7 +48,7 @@ func (s *HTTPHandlers) peeringRead(resp http.ResponseWriter, req *http.Request,
|
|||
return nil, err
|
||||
}
|
||||
if result.Peering == nil {
|
||||
return nil, HTTPError{StatusCode: http.StatusNotFound}
|
||||
return nil, HTTPError{StatusCode: http.StatusNotFound, Reason: fmt.Sprintf("Peering not found for %q", name)}
|
||||
}
|
||||
|
||||
// TODO(peering): replace with API types
|
||||
|
|
|
@ -292,6 +292,7 @@ func TestHTTP_Peering_Read(t *testing.T) {
|
|||
resp := httptest.NewRecorder()
|
||||
a.srv.h.ServeHTTP(resp, req)
|
||||
require.Equal(t, http.StatusNotFound, resp.Code)
|
||||
require.Equal(t, "Peering not found for \"baz\"", resp.Body.String())
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue