diff options
Diffstat (limited to 'lib/mattermost')
-rw-r--r-- | lib/mattermost/client.rb | 4 | ||||
-rw-r--r-- | lib/mattermost/session.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/mattermost/client.rb b/lib/mattermost/client.rb index fa3c9fa27bd..ec2903b7ec6 100644 --- a/lib/mattermost/client.rb +++ b/lib/mattermost/client.rb @@ -30,12 +30,12 @@ module Mattermost json_response = JSON.parse(response.body) unless response.success? - raise ClientError(json_response['message'] || 'Undefined error') + raise Mattermost::ClientError.new(json_response['message'] || 'Undefined error') end json_response rescue JSON::JSONError - raise ClientError('Cannot parse response') + raise Mattermost::ClientError.new('Cannot parse response') end end end diff --git a/lib/mattermost/session.rb b/lib/mattermost/session.rb index 8fcd4a84af5..ddfeb88a71f 100644 --- a/lib/mattermost/session.rb +++ b/lib/mattermost/session.rb @@ -81,9 +81,9 @@ module Mattermost def post(path, options = {}) self.class.post(path, options.merge(headers: @headers)) rescue HTTParty::Error => e - raise ConnectionError(e.message) + raise Mattermost::ConnectionError.new(e.message) rescue Errno::ECONNREFUSED - raise ConnectionError + raise Mattermost::ConnectionError.new(e.message) end private |