diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-01-26 09:16:07 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-01-30 11:01:36 +0100 |
commit | b3de65bcc5627915511182a9ac9857b1fef14853 (patch) | |
tree | 537c79d5c1f03b1306556b3abf20a5bb3fe565dc /app/models | |
parent | 8bcc911b9bc9fcb2179860c5a98d8a1ad3ec34b0 (diff) | |
download | gitlab-ce-b3de65bcc5627915511182a9ac9857b1fef14853.tar.gz |
Update #list_teams to propagate errors
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project_services/mattermost_slash_commands_service.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/project_services/mattermost_slash_commands_service.rb b/app/models/project_services/mattermost_slash_commands_service.rb index 548163f38fa..b0f7a42f9a3 100644 --- a/app/models/project_services/mattermost_slash_commands_service.rb +++ b/app/models/project_services/mattermost_slash_commands_service.rb @@ -28,10 +28,10 @@ class MattermostSlashCommandsService < ChatSlashCommandsService [false, e.message] end - def list_teams(user) - Mattermost::Team.new(user).all - rescue Mattermost::Error - [] + def list_teams(current_user) + [Mattermost::Team.new(current_user).all, nil] + rescue Mattermost::Error => e + [[], e.message] end private |