summaryrefslogtreecommitdiffstats
path: root/cmd/commands/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/commands/user.go')
-rw-r--r--cmd/commands/user.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/commands/user.go b/cmd/commands/user.go
index da3fb454b..7397cfb2e 100644
--- a/cmd/commands/user.go
+++ b/cmd/commands/user.go
@@ -422,6 +422,10 @@ func updateUserEmailCmdF(command *cobra.Command, args []string) error {
}
defer a.Shutdown()
+ if len(args) != 2 {
+ return errors.New("Expected two arguments. See help text for details.")
+ }
+
newEmail := args[1]
if !model.IsValidEmail(newEmail) {
@@ -440,7 +444,7 @@ func updateUserEmailCmdF(command *cobra.Command, args []string) error {
user.Email = newEmail
_, errUpdate := a.UpdateUser(user, true)
if errUpdate != nil {
- return errUpdate
+ return errors.New(errUpdate.Message)
}
return nil