correct http status code for racs/getfaillist api

This commit is contained in:
r0n1n7an 2024-11-22 15:17:03 +08:00
parent 9950e7d6ab
commit 7a3a282c71

View File

@ -592,8 +592,11 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) {
rst["Result"] = "NG"
rst["ErrMsg"] = "racs.HandleGetFailList: " + err.Error()
logger.Printf("[ERR] %s; %s; %s\r\n", addr, uri, rst["ErrMsg"])
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "%v", rpl.Replace(fmt.Sprintf("%#v", rst)))
return
}
w.WriteHeader(http.StatusInternalServerError)
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "%v", rpl.Replace(string(jsonData)))
return
}