Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-05-19 22:58:45 +0300
committerMichael Kozono <mkozono@gmail.com>2017-06-05 15:32:26 +0300
commit23d37382dabe3f7c7f2e11df2731de8e939e0cab (patch)
treec0730c393fef5582dfdfdbbd41ad8340a5c5cd45 /lib/gitlab/git_access_wiki.rb
parent957edb13fdb21e21efbc68fc342209f4b53a66e4 (diff)
Refactor to let GitAccess errors bubble up
No external behavior change. This allows `GitHttpController` to set the HTTP status based on the type of error. Alternatively, we could have added an attribute to GitAccessStatus, but this pattern seemed appropriate.
Diffstat (limited to 'lib/gitlab/git_access_wiki.rb')
-rw-r--r--lib/gitlab/git_access_wiki.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb
index dccafd2cae8..4c87482430f 100644
--- a/lib/gitlab/git_access_wiki.rb
+++ b/lib/gitlab/git_access_wiki.rb
@@ -16,7 +16,7 @@ module Gitlab
if user_access.can_do_action?(:create_wiki)
build_status_object(true)
else
- build_status_object(false, ERROR_MESSAGES[:write_to_wiki])
+ raise UnauthorizedError, ERROR_MESSAGES[:write_to_wiki]
end
end
end