Separate HTTP Error codes for the Merge Request API
Description
Currently, the merge requests API always returns 422 if there's an error while handling the request - see handle_merge_request_errors! in lib/api/merge_requests.rb. This makes debugging of the root cause more complicated than it should be.
Proposal
Return a different error code for each issue. The error codes should also be documented (there's no mention of return code 422 in the API documentation right now).
Edited by 🤖 GitLab Bot 🤖