diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-23 21:35:45 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-23 21:35:45 +0300 |
commit | d0e3ab58260a19ccb82d6703ba6eb4942a4f297d (patch) | |
tree | 7acc39c7586acfcc12b0d1760905a37197dd626a /lib/api/merge_requests.rb | |
parent | 3c9ea7f4a90a4d3902b36a94678f6f39c1a1cc61 (diff) | |
parent | 998cd3cb63d56a0058c8e519d7c20e3d6e540899 (diff) | |
download | gitlab-ce-d0e3ab58260a19ccb82d6703ba6eb4942a4f297d.tar.gz |
Merge branch 'api/improve-error-reporting' of https://github.com/jubianchi/gitlabhq into jubianchi-api/improve-error-reporting
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r-- | lib/api/merge_requests.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 172c8504d0f..a365f1db00f 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -10,8 +10,13 @@ module API error!(errors[:project_access], 422) elsif errors[:branch_conflict].any? error!(errors[:branch_conflict], 422) + elsif errors[:validate_fork].any? + error!(errors[:validate_fork], 422) + elsif errors[:validate_branches].any? + conflict!(errors[:validate_branches]) end - not_found! + + render_api_error!(errors, 400) end end @@ -228,7 +233,7 @@ module API if note.save present note, with: Entities::MRNote else - not_found! + render_validation_error!(note) end end end |