Provide better diagnostic message upon project creation errors
Prevents an Error 500 when project fails to create due to invalid parameters. See #3937
This commit is contained in:
parent
3cf4054854
commit
8d5527007a
2 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
|
|||
|
||||
v 8.3.0 (unreleased)
|
||||
- Merge when build succeeds (Zeger-Jan van de Weg)
|
||||
- Provide better diagnostic message upon project creation errors (Stan Hu)
|
||||
- Bump gollum-lib to 4.1.0 (Stan Hu)
|
||||
- Fix broken group avatar upload under "New group" (Stan Hu)
|
||||
- Update project repositorize size and commit count during import:repos task (Stan Hu)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue