diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /lib/mattermost/session.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'lib/mattermost/session.rb')
-rw-r--r-- | lib/mattermost/session.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/mattermost/session.rb b/lib/mattermost/session.rb index 523d82f9161..9374c5c8f8f 100644 --- a/lib/mattermost/session.rb +++ b/lib/mattermost/session.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true module Mattermost - class NoSessionError < Mattermost::Error + class NoSessionError < ::Mattermost::Error def message 'No session could be set up, is Mattermost configured with Single Sign On?' end end - ConnectionError = Class.new(Mattermost::Error) + ConnectionError = Class.new(::Mattermost::Error) # This class' prime objective is to obtain a session token on a Mattermost # instance with SSO configured where this GitLab instance is the provider. @@ -42,7 +42,7 @@ module Mattermost yield self rescue Errno::ECONNREFUSED => e Gitlab::AppLogger.error(e.message + "\n" + e.backtrace.join("\n")) - raise Mattermost::NoSessionError + raise ::Mattermost::NoSessionError ensure destroy end @@ -100,11 +100,11 @@ module Mattermost end def create - raise Mattermost::NoSessionError unless oauth_uri - raise Mattermost::NoSessionError unless token_uri + raise ::Mattermost::NoSessionError unless oauth_uri + raise ::Mattermost::NoSessionError unless token_uri @token = request_token - raise Mattermost::NoSessionError unless @token + raise ::Mattermost::NoSessionError unless @token @headers = { Authorization: "Bearer #{@token}" @@ -174,9 +174,9 @@ module Mattermost def handle_exceptions yield rescue Gitlab::HTTP::Error => e - raise Mattermost::ConnectionError, e.message + raise ::Mattermost::ConnectionError, e.message rescue Errno::ECONNREFUSED => e - raise Mattermost::ConnectionError, e.message + raise ::Mattermost::ConnectionError, e.message end def parse_cookie(response) |