summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-08 20:52:13 -0800
committerStan Hu <stanhu@gmail.com>2015-12-09 09:50:16 -0800
commit8d5527007a3cca93dabe7324f8fffbabdc7664d0 (patch)
tree51243c50f5845482a52c2a0b43b906e23bf2b6bd /app
parent3cf40548544f716d89749541ac1c4318ffe5af70 (diff)
downloadgitlab-ce-8d5527007a3cca93dabe7324f8fffbabdc7664d0.tar.gz
Provide better diagnostic message upon project creation errors
Prevents an Error 500 when project fails to create due to invalid parameters. See #3937
Diffstat (limited to 'app')
-rw-r--r--app/services/projects/create_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 700a1db04d8..a6820183bee 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -64,8 +64,10 @@ module Projects
after_create_actions if @project.persisted?
@project
- rescue
- @project.errors.add(:base, "Can't save project. Please try again later")
+ rescue => e
+ message = "Unable to save project: #{e.message}"
+ Rails.logger.error(message)
+ @project.errors.add(:base, message) if @project
@project
end