diff --git a/api/api.go b/api/api.go index 12cefe1..07ebf8b 100644 --- a/api/api.go +++ b/api/api.go @@ -168,6 +168,10 @@ func makeHandler(ctrl libnetwork.NetworkController, fct processor) http.HandlerF } res, rsp := fct(ctrl, mux.Vars(req), body) + if !rsp.isOK() { + http.Error(w, rsp.Status, rsp.StatusCode) + return + } if res != nil { writeJSON(w, rsp.StatusCode, res) }