From 998cd3cb63d56a0058c8e519d7c20e3d6e540899 Mon Sep 17 00:00:00 2001 From: jubianchi Date: Mon, 18 Aug 2014 20:09:09 +0200 Subject: Improve error reporting on users API * users (#6878, #3526, #4209): Validation error messages are now exposed through 400 responses, 409 response are sent in case of duplicate email or username * MRs (#5335): 409 responses are sent in case of duplicate merge request (source/target branches), 422 responses are sent when submiting MR fo/from unrelated forks * issues * labels * projects --- lib/api/projects.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/projects.rb') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 55f7975bbf7..f555819df1b 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -111,7 +111,7 @@ module API if @project.errors[:limit_reached].present? error!(@project.errors[:limit_reached], 403) end - not_found! + render_validation_error!(@project) end end @@ -149,7 +149,7 @@ module API if @project.saved? present @project, with: Entities::Project else - not_found! + render_validation_error!(@project) end end -- cgit v1.2.1