diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-08 20:52:13 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-09 09:50:16 -0800 |
commit | 8d5527007a3cca93dabe7324f8fffbabdc7664d0 (patch) | |
tree | 51243c50f5845482a52c2a0b43b906e23bf2b6bd /app | |
parent | 3cf40548544f716d89749541ac1c4318ffe5af70 (diff) | |
download | gitlab-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.rb | 6 |
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 |