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.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dfe6478fd7
Коммит
4b64eb0e39
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user