Log error from api json encode

This commit is contained in:
Martin Boehm 2019-03-20 18:04:52 +01:00
parent 6784ecd6b3
commit bae1050ce4

View File

@ -265,7 +265,10 @@ func (s *PublicServer) jsonHandler(handler func(r *http.Request, apiVersion int)
if e, isError := data.(jsonError); isError {
w.WriteHeader(e.HTTPStatus)
}
json.NewEncoder(w).Encode(data)
err = json.NewEncoder(w).Encode(data)
if err != nil {
glog.Warning("json encode ", err)
}
}()
data, err = handler(r, apiVersion)
if err != nil || data == nil {