summaryrefslogtreecommitdiff
path: root/app/models/project_services/mattermost_slash_commands_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project_services/mattermost_slash_commands_service.rb')
-rw-r--r--app/models/project_services/mattermost_slash_commands_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_services/mattermost_slash_commands_service.rb b/app/models/project_services/mattermost_slash_commands_service.rb
index 572a02b01d4..4c2b7d64f1f 100644
--- a/app/models/project_services/mattermost_slash_commands_service.rb
+++ b/app/models/project_services/mattermost_slash_commands_service.rb
@@ -19,15 +19,19 @@ class MattermostSlashCommandsService < ChatSlashCommandsService
'mattermost_slash_commands'
end
- def configure!(user, params)
+ def configure(user, params)
token = Mattermost::Command.new(user).
create(command(params))
- update!(active: true, token: token)
+ update(active: true, token: token) if token
+ rescue => Mattermost::Error => e
+ false, e.message
end
def list_teams(user)
Mattermost::Team.new(user).all
+ rescue => Mattermost::Error => e
+ []
end
private