mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-04-29 11:25:50 +00:00
Don't discard error message on sending response
Error messages are always discarded and it makes diagnostic difficult
when error occurs.
Before:
$ dnet network create -d overlay ov1
error : ""
$ docker network create -d overlay ov1
Error response from daemon: ""
After:
$ dnet network create -d overlay ov1
error : "no datastore configured. cannot obtain vxlan id"
$ docker network create -d overlay ov1
Error response from daemon: "no datastore configured. cannot obtain vxlan id"
Breakage caused by 7b8bb3e
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
This commit is contained in:
committed by
Alessandro Boch
parent
a125c33787
commit
8aa9f4eee6
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user