From 4b9eb73bd218e4a8a5123e292dd7a2654d45fc4f Mon Sep 17 00:00:00 2001 From: Alenoda <123820353+Alenoda@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:59:24 +0100 Subject: [PATCH] Fix errcheck issues in server/channels/app/plugin_reattach (#29115) Co-authored-by: Ben Schumacher --- server/.golangci.yml | 1 - server/channels/app/plugin_reattach.go | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 03365f1e3e..e6e1c26cc1 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -139,7 +139,6 @@ issues: channels/app/plugin_health_check_test.go|\ channels/app/plugin_hooks_test.go|\ channels/app/plugin_install.go|\ - channels/app/plugin_reattach.go|\ channels/app/plugin_requests.go|\ channels/app/plugin_signature.go|\ channels/app/plugin_signature_test.go|\ diff --git a/server/channels/app/plugin_reattach.go b/server/channels/app/plugin_reattach.go index 846c681a5c..2cab6abe69 100644 --- a/server/channels/app/plugin_reattach.go +++ b/server/channels/app/plugin_reattach.go @@ -20,7 +20,10 @@ func (ch *Channels) ReattachPlugin(manifest *model.Manifest, pluginReattachConfi return model.NewAppError("ReattachPlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented) } - ch.DetachPlugin(manifest.Id) + appErr := ch.DetachPlugin(manifest.Id) + if appErr != nil { + return appErr + } // Reattach to the plugin if err := pluginsEnvironment.Reattach(manifest, pluginReattachConfig); err != nil {