Fix errcheck issue in handlers.go (#28794)

Этот коммит содержится в:
TheInvincible
2024-10-17 11:37:41 +01:00
коммит произвёл GitHub
родитель 347ca15f8d
Коммит 0cb2475ea4
2 изменённых файлов: 3 добавлений и 2 удалений

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

@@ -261,7 +261,6 @@ issues:
channels/utils/fileutils/fileutils_test.go|\
channels/utils/license_test.go|\
channels/utils/subpath_test.go|\
channels/web/handlers.go|\
channels/web/oauth.go|\
channels/web/oauth_test.go|\
channels/web/response_writer_wrapper_test.go|\

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

@@ -450,7 +450,9 @@ func (h Handler) handleContextError(c *Context, w http.ResponseWriter, r *http.R
if IsAPICall(c.App, r) || IsWebhookCall(c.App, r) || IsOAuthAPICall(c.App, r) || r.Header.Get("X-Mobile-App") != "" {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(c.Err.StatusCode)
w.Write([]byte(c.Err.ToJSON()))
if _, err := w.Write([]byte(c.Err.ToJSON())); err != nil {
c.Logger.Error("Failed to write error response", mlog.Err(err))
}
} else {
utils.RenderWebAppError(c.App.Config(), w, r, c.Err, c.App.AsymmetricSigningKey())
}