Commit 0b049a7b authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'changelog-api-422' into 'master'

Use HTTP 422 for changelog API errors

See merge request gitlab-org/gitlab!54334
parents 71e1a511 8182dcdf
...@@ -227,7 +227,7 @@ module API ...@@ -227,7 +227,7 @@ module API
service.execute service.execute
status(200) status(200)
rescue Gitlab::Changelog::Error => ex rescue Gitlab::Changelog::Error => ex
render_api_error!("Failed to generate the changelog: #{ex.message}", 500) render_api_error!("Failed to generate the changelog: #{ex.message}", 422)
end end
end end
end end
......
...@@ -687,7 +687,7 @@ RSpec.describe API::Repositories do ...@@ -687,7 +687,7 @@ RSpec.describe API::Repositories do
} }
) )
expect(response).to have_gitlab_http_status(:internal_server_error) expect(response).to have_gitlab_http_status(:unprocessable_entity)
expect(json_response['message']).to eq('Failed to generate the changelog: oops') expect(json_response['message']).to eq('Failed to generate the changelog: oops')
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