use the error value

This commit is contained in:
Fran Bull 2025-02-21 13:02:05 -08:00
parent 82e6b2508a
commit 4040e14cb8

View File

@ -142,6 +142,10 @@ func (c *Consensus) makeCommandMux(auth *authorization) *http.ServeMux {
return
}
result, err := c.executeCommandLocally(cmd)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
if err := json.NewEncoder(w).Encode(result); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return