summaryrefslogtreecommitdiff
path: root/lib/api/api_guard.rb
diff options
context:
space:
mode:
authorFrancisco Lopez <fjlopez@gitlab.com>2017-11-10 11:41:33 +0100
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 10:02:11 +0100
commitf1896575237cb92dce5a413bb6b6cc6474cbb19d (patch)
tree441e6f004dbd5ecadc9e2ec8bed5182bc7ffe105 /lib/api/api_guard.rb
parent2d5397d928cfca222addb250085fe30c72215022 (diff)
downloadgitlab-ce-f1896575237cb92dce5a413bb6b6cc6474cbb19d.tar.gz
Added some more comments
Diffstat (limited to 'lib/api/api_guard.rb')
-rw-r--r--lib/api/api_guard.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb
index e2a1a51b300..0caf2aa25bc 100644
--- a/lib/api/api_guard.rb
+++ b/lib/api/api_guard.rb
@@ -139,13 +139,14 @@ module API
# Exceptions
#
- MissingTokenError = Class.new(StandardError)
- TokenNotFoundError = Class.new(StandardError)
- ExpiredError = Class.new(StandardError)
- RevokedError = Class.new(StandardError)
- UnauthorizedError = Class.new(StandardError)
-
- class InsufficientScopeError < StandardError
+ AuthenticationException = Class.new(StandardError)
+ MissingTokenError = Class.new(AuthenticationException)
+ TokenNotFoundError = Class.new(AuthenticationException)
+ ExpiredError = Class.new(AuthenticationException)
+ RevokedError = Class.new(AuthenticationException)
+ UnauthorizedError = Class.new(AuthenticationException)
+
+ class InsufficientScopeError < AuthenticationException
attr_reader :scopes
def initialize(scopes)
@scopes = scopes.map { |s| s.try(:name) || s }