API: status code 403 returned if new project would exceed limit
When the project limit is reached the user is not allowed to create new ones. Instead of error code 404 the status code 403 (Forbidden) is returned with error message via API.
This commit is contained in:
parent
6fc3263e15
commit
6df02adc7a
3 changed files with 17 additions and 1 deletions
|
@ -58,6 +58,9 @@ module Gitlab
|
|||
if @project.saved?
|
||||
present @project, with: Entities::Project
|
||||
else
|
||||
if @project.errors[:limit_reached].present?
|
||||
error!(@project.errors[:limit_reached], 403)
|
||||
end
|
||||
not_found!
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue