Commit 8b3397bd authored by Imre Farkas's avatar Imre Farkas

Merge branch '326839-improve-message' into 'master'

Improve error message for project not found

See merge request gitlab-org/gitlab!58945
parents 81ab85a4 526901e8
---
title: Improve message for :project_not_found error to indicate possible cause
merge_request: 58945
author: Ignacy Moryc @ignacy
type: changed
...@@ -534,7 +534,7 @@ RSpec.describe "Git HTTP requests (Geo)", :geo do ...@@ -534,7 +534,7 @@ RSpec.describe "Git HTTP requests (Geo)", :geo do
it 'returns a 404' do it 'returns a 404' do
is_expected.to have_gitlab_http_status(:not_found) is_expected.to have_gitlab_http_status(:not_found)
expect(response.body).to eql('The project you were looking for could not be found.') expect(response.body).to eql("The project you were looking for could not be found or you don't have permission to view it.")
end end
end end
......
...@@ -22,7 +22,7 @@ module Gitlab ...@@ -22,7 +22,7 @@ module Gitlab
auth_download: 'You are not allowed to download code.', auth_download: 'You are not allowed to download code.',
deploy_key_upload: 'This deploy key does not have write access to this project.', deploy_key_upload: 'This deploy key does not have write access to this project.',
no_repo: 'A repository for this project does not exist yet.', no_repo: 'A repository for this project does not exist yet.',
project_not_found: 'The project you were looking for could not be found.', project_not_found: "The project you were looking for could not be found or you don't have permission to view it.",
command_not_allowed: "The command you're trying to execute is not allowed.", command_not_allowed: "The command you're trying to execute is not allowed.",
upload_pack_disabled_over_http: 'Pulling over HTTP is not allowed.', upload_pack_disabled_over_http: 'Pulling over HTTP is not allowed.',
receive_pack_disabled_over_http: 'Pushing over HTTP is not allowed.', receive_pack_disabled_over_http: 'Pushing over HTTP is not allowed.',
......
...@@ -554,19 +554,19 @@ RSpec.describe Gitlab::GitAccess do ...@@ -554,19 +554,19 @@ RSpec.describe Gitlab::GitAccess do
context 'when the repository is public' do context 'when the repository is public' do
let(:options) { %i[repository_enabled] } let(:options) { %i[repository_enabled] }
it { expect { pull_access_check }.to raise_error('The project you were looking for could not be found.') } it { expect { pull_access_check }.to raise_error("The project you were looking for could not be found or you don't have permission to view it.") }
end end
context 'when the repository is private' do context 'when the repository is private' do
let(:options) { %i[repository_private] } let(:options) { %i[repository_private] }
it { expect { pull_access_check }.to raise_error('The project you were looking for could not be found.') } it { expect { pull_access_check }.to raise_error("The project you were looking for could not be found or you don't have permission to view it.") }
end end
context 'when the repository is disabled' do context 'when the repository is disabled' do
let(:options) { %i[repository_disabled] } let(:options) { %i[repository_disabled] }
it { expect { pull_access_check }.to raise_error('The project you were looking for could not be found.') } it { expect { pull_access_check }.to raise_error("The project you were looking for could not be found or you don't have permission to view it.") }
end end
end end
end end
...@@ -596,13 +596,13 @@ RSpec.describe Gitlab::GitAccess do ...@@ -596,13 +596,13 @@ RSpec.describe Gitlab::GitAccess do
context 'when the repository is private' do context 'when the repository is private' do
let(:options) { %i[repository_private] } let(:options) { %i[repository_private] }
it { expect { pull_access_check }.to raise_error('The project you were looking for could not be found.') } it { expect { pull_access_check }.to raise_error("The project you were looking for could not be found or you don't have permission to view it.") }
end end
context 'when the repository is disabled' do context 'when the repository is disabled' do
let(:options) { %i[repository_disabled] } let(:options) { %i[repository_disabled] }
it { expect { pull_access_check }.to raise_error('The project you were looking for could not be found.') } it { expect { pull_access_check }.to raise_error("The project you were looking for could not be found or you don't have permission to view it.") }
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment