Commit 9f1361f5 authored by Kerri Miller's avatar Kerri Miller

Merge branch 'hchouraria-github-importer-present-http-status-code-during-error' into 'master'

Expose HTTP code during GitHub importer errors

See merge request gitlab-org/gitlab!83818
parents d07b33b4 463c8c66
......@@ -117,7 +117,7 @@ module Import
error: exception.response_body
)
error(_('Import failed due to a GitHub error: %{original}') % { original: exception.response_body }, :unprocessable_entity)
error(_('Import failed due to a GitHub error: %{original} (HTTP %{code})') % { original: exception.response_body, code: exception.response_status }, :unprocessable_entity)
end
def log_and_return_error(message, translated_message, http_status)
......
......@@ -18864,7 +18864,7 @@ msgstr ""
msgid "Import and export rate limits"
msgstr ""
msgid "Import failed due to a GitHub error: %{original}"
msgid "Import failed due to a GitHub error: %{original} (HTTP %{code})"
msgstr ""
msgid "Import from"
......
......@@ -34,11 +34,11 @@ RSpec.describe Import::GithubService do
subject.execute(access_params, :github)
end
it 'returns an error' do
it 'returns an error with message and code' do
result = subject.execute(access_params, :github)
expect(result).to include(
message: 'Import failed due to a GitHub error: Not Found',
message: 'Import failed due to a GitHub error: Not Found (HTTP 404)',
status: :error,
http_status: :unprocessable_entity
)
......
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