diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-12 15:18:22 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-01-12 22:14:08 -0800 |
commit | 660dcd5b7c038f86002ddecf3562e1b7018e143c (patch) | |
tree | dad44705328349dc4e0ed66253e65e6cee255776 /spec/controllers | |
parent | 1161c99e5c5a6e717127b83665de00068d810e0e (diff) | |
download | gitlab-ce-660dcd5b7c038f86002ddecf3562e1b7018e143c.tar.gz |
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')
-rw-r--r-- | spec/controllers/import/bitbucket_server_controller_spec.rb | 2 |
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 |