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:
authorStan Hu <stanhu@gmail.com>2019-01-13 02:18:22 +0300
committerStan Hu <stanhu@gmail.com>2019-01-13 09:14:08 +0300
commit660dcd5b7c038f86002ddecf3562e1b7018e143c (patch)
treedad44705328349dc4e0ed66253e65e6cee255776 /spec/controllers/import
parent1161c99e5c5a6e717127b83665de00068d810e0e (diff)
Fix Bitbucket Server importer error handling
The importer would display a 500 error page if you attempted to import using a non-existent DNS entry. This commit rescues known network issues and consolidates them into BitbucketServer::Connection::ConnectionError`. The previous error handling in the paginator doesn't work because it returns a lazy collection. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56154
Diffstat (limited to 'spec/controllers/import')
-rw-r--r--spec/controllers/import/bitbucket_server_controller_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/controllers/import/bitbucket_server_controller_spec.rb b/spec/controllers/import/bitbucket_server_controller_spec.rb
index 73195463a50..bb282db5a41 100644
--- a/spec/controllers/import/bitbucket_server_controller_spec.rb
+++ b/spec/controllers/import/bitbucket_server_controller_spec.rb
@@ -78,7 +78,7 @@ describe Import::BitbucketServerController do
end
it "returns an error when the server can't be contacted" do
- expect(client).to receive(:repo).with(project_key, repo_slug).and_raise(BitbucketServer::Client::ServerError)
+ expect(client).to receive(:repo).with(project_key, repo_slug).and_raise(::BitbucketServer::Connection::ConnectionError)
post :create, params: { project: project_key, repository: repo_slug }, format: :json