diff --git a/prog/weaver/http.go b/prog/weaver/http.go index c432e849..a53f59c8 100644 --- a/prog/weaver/http.go +++ b/prog/weaver/http.go @@ -161,7 +161,12 @@ func HandleHTTP(muxRouter *mux.Router, version string, router *weave.Router, all } muxRouter.Methods("GET").Path("/report").Headers("Accept", "application/json").HandlerFunc( func(w http.ResponseWriter, r *http.Request) { - json, _ := json.MarshalIndent(status(), "", " ") + json, err := json.MarshalIndent(status(), "", " ") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + Log.Error("Error during report marshalling: ", err) + return + } w.Header().Set("Content-Type", "application/json") w.Write(json) })