GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 9755b5ab authored by Stan Hu's avatar Stan Hu Committed by GitLab Release Tools Bot

Merge branch 'fj-60827-fix-web-strategy-error' into 'master'

Fix bug when project export to remote url fails

Closes #60827

See merge request gitlab-org/gitlab-ce!27614

(cherry picked from commit 90ddfda6)

aa0345a4 Fix error info retrieval on web project export
parent a1e417e5
title: Fix bug when project export to remote url fails
merge_request: 27614
type: fixed
......@@ -30,10 +30,7 @@ def strategy_execute
def handle_response_error(response)
unless response.success?
error_code = response.dig('Error', 'Code') || response.code
error_message = response.dig('Error', 'Message') || response.message
raise"Error uploading the project. Code #{error_code}: #{error_message}")
raise"Error uploading the project. Code #{response.code}: #{response.message}")
......@@ -32,5 +32,17 @@
strategy.execute(user, project)
context 'when upload fails' do
it 'stores the export error' do
stub_request(:post, example_url).to_return(status: [404, 'Page not found'])
strategy.execute(user, project)
errors = project.import_export_shared.errors
expect(errors).not_to be_empty
expect(errors.first).to eq "Error uploading the project. Code 404: Page not found"
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