MM-45198: Migrate app/import and api4/import (#20799)
We migrate them to use logger context. https://mattermost.atlassian.net/browse/MM-45198 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5e00295b5a
Коммит
d9d75b1a7d
@@ -8,6 +8,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
)
|
||||
|
||||
func (api *API) InitImport() {
|
||||
@@ -26,11 +27,7 @@ func listImports(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := json.Marshal(imports)
|
||||
if err != nil {
|
||||
c.Err = model.NewAppError("listImports", "app.import.marshal.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
return
|
||||
if err := json.NewEncoder(w).Encode(imports); err != nil {
|
||||
c.Logger.Warn("Error writing imports", mlog.Err(err))
|
||||
}
|
||||
|
||||
w.Write(data)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user