f-21: debug: use err correct returne for kv db
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
921a5ca96e
commit
6b104c4784
5 changed files with 25 additions and 7 deletions
|
|
@ -88,7 +88,12 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
s.dispatcher.Dispatch(cmd)
|
||||
entries, _ := kv.ListByPrefix(s.db, "subnet/"+req.Name+"/")
|
||||
entries, err := kv.ListByPrefix(s.db, "subnet/"+req.Name+"/")
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
json.NewEncoder(w).Encode(ErrorResponse{Error: "failed to read subnet state"})
|
||||
return
|
||||
}
|
||||
sub := Subnet{Name: req.Name}
|
||||
for key, value := range entries {
|
||||
parts := strings.Split(key, "/")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue