diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 12:02:37 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 12:02:37 +0100 |
commit | 0cf23fde7c666b64e6c18a92d29e632f51b00059 (patch) | |
tree | 943171ba614758895e88bd1b69d2add1a517da91 /lib/mattermost/client.rb | |
parent | d305d15b6dde99b0de7fc78242aaa095fc79b5ca (diff) | |
download | gitlab-ce-0cf23fde7c666b64e6c18a92d29e632f51b00059.tar.gz |
Work on tests for mattermost
Diffstat (limited to 'lib/mattermost/client.rb')
-rw-r--r-- | lib/mattermost/client.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mattermost/client.rb b/lib/mattermost/client.rb index 8bbb2038772..d6759eac0d0 100644 --- a/lib/mattermost/client.rb +++ b/lib/mattermost/client.rb @@ -1,4 +1,6 @@ module Mattermost + class ClientError < Mattermost::Error; end + class Client attr_reader :user @@ -30,9 +32,9 @@ module Mattermost if response.success? json_response elsif json_response['message'] - raise json_response['message'] + raise ClientError(json_response['message']) else - raise 'Undefined error' + raise ClientError('Undefined error') end end end |