mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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 11094f2
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
This commit is contained in:
parent
aad77d46dd
commit
af323c7006
1 changed files with 4 additions and 0 deletions
|
@ -168,6 +168,10 @@ func makeHandler(ctrl libnetwork.NetworkController, fct processor) http.HandlerF
|
||||||
}
|
}
|
||||||
|
|
||||||
res, rsp := fct(ctrl, mux.Vars(req), body)
|
res, rsp := fct(ctrl, mux.Vars(req), body)
|
||||||
|
if !rsp.isOK() {
|
||||||
|
http.Error(w, rsp.Status, rsp.StatusCode)
|
||||||
|
return
|
||||||
|
}
|
||||||
if res != nil {
|
if res != nil {
|
||||||
writeJSON(w, rsp.StatusCode, res)
|
writeJSON(w, rsp.StatusCode, res)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue