diff --git a/server/.golangci.yml b/server/.golangci.yml index 423827d5f6..059a3ed009 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -89,7 +89,8 @@ issues: channels/api4/plugin.go|\ channels/api4/plugin_test.go|\ channels/api4/post_test.go|\ - channels/api4/reaction.go|\ + channels/api4/preference_test.go|\ + channels/api4/reaction_test.go|\ channels/api4/remote_cluster.go|\ channels/api4/role.go|\ channels/api4/role_test.go|\ diff --git a/server/channels/api4/reaction.go b/server/channels/api4/reaction.go index 9b6cfcbfc9..a9fb7c0e7d 100644 --- a/server/channels/api4/reaction.go +++ b/server/channels/api4/reaction.go @@ -74,7 +74,9 @@ func getReactions(c *Context, w http.ResponseWriter, r *http.Request) { return } - w.Write(js) + if _, err := w.Write(js); err != nil { + c.Logger.Warn("Error while writing js response", mlog.Err(err)) + } } func deleteReaction(c *Context, w http.ResponseWriter, r *http.Request) { @@ -131,5 +133,7 @@ func getBulkReactions(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = model.NewAppError("getBulkReactions", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err) return } - w.Write(js) + if _, err := w.Write(js); err != nil { + c.Logger.Warn("Error while writing js response", mlog.Err(err)) + } }