summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-10-02 19:33:52 +0200
committerGitHub <noreply@github.com>2018-10-02 19:33:52 +0200
commit2945e8a2b0ce9306bb049e65eb2410038e0fa18c (patch)
treecee7c4edc0a947496caec9bf9e6b84b09231d926 /cmd
parentc82a84ed765bd9c4d601b93201d93af92f6ee742 (diff)
downloadchat-2945e8a2b0ce9306bb049e65eb2410038e0fa18c.tar.gz
chat-2945e8a2b0ce9306bb049e65eb2410038e0fa18c.tar.bz2
chat-2945e8a2b0ce9306bb049e65eb2410038e0fa18c.zip
MM-10699: Disallow renaming direct and group message channels (#9518)
* MM-10699: Disallow renaming direct and group message channels * Replacing errors.New with errors.Wrapf
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mattermost/commands/channel.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/mattermost/commands/channel.go b/cmd/mattermost/commands/channel.go
index 270ed6586..7fb8fea8c 100644
--- a/cmd/mattermost/commands/channel.go
+++ b/cmd/mattermost/commands/channel.go
@@ -4,11 +4,11 @@
package commands
import (
- "errors"
"fmt"
"github.com/mattermost/mattermost-server/app"
"github.com/mattermost/mattermost-server/model"
+ "github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -518,7 +518,7 @@ func modifyChannelCmdF(command *cobra.Command, args []string) error {
user := getUserFromUserArg(a, username)
if _, err := a.UpdateChannelPrivacy(channel, user); err != nil {
- return errors.New("Failed to update channel ('" + args[0] + "') privacy - " + err.Error())
+ return errors.Wrapf(err, "Failed to update channel ('%s') privacy", args[0])
}
return nil
@@ -549,7 +549,7 @@ func renameChannelCmdF(command *cobra.Command, args []string) error {
_, errch := a.RenameChannel(channel, newChannelName, newDisplayName)
if errch != nil {
- return errors.New("Error in updating channel from " + channel.Name + " to " + newChannelName + err.Error())
+ return errors.Wrapf(errch, "Error in updating channel from %s to %s", channel.Name, newChannelName)
}
return nil