Handle error returned by GetClusterInfos() (#30919)

A recent change to the enterprise cluster code introduced a change to the enterprise API interface. GetClusterInfos() can now return an error. This commit introduces code to handle that error.
Этот коммит содержится в:
David Krauser
2025-05-12 13:37:58 -04:00
коммит произвёл GitHub
родитель dfe6478fd7
Коммит 4b64eb0e39
10 изменённых файлов: 48 добавлений и 28 удалений

Просмотреть файл

@@ -20,7 +20,12 @@ func getClusterStatus(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
infos := c.App.GetClusterStatus(c.AppContext)
infos, err := c.App.GetClusterStatus(c.AppContext)
if err != nil {
c.Err = model.NewAppError("getClusterStatus", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
return
}
js, err := json.Marshal(infos)
if err != nil {
c.Err = model.NewAppError("getClusterStatus", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)