diff options
author | Robert Speicher <robert@gitlab.com> | 2017-04-14 00:45:55 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-14 00:45:55 +0000 |
commit | 0497d3eadb67f347a6376c77cbd39511e5136bfb (patch) | |
tree | 185478dc11d29253b85058ece977a31f43ea998f /app | |
parent | 0e15e432adfd74576977c8abd5cf5cdffc02102a (diff) | |
parent | 460fb1fabab8f9afd364055e9d9b212dbb7f8c82 (diff) | |
download | gitlab-ce-0497d3eadb67f347a6376c77cbd39511e5136bfb.tar.gz |
Merge branch 'sh-improve-logging-for-bad-creations' into 'master'
Improve error messages when a record is unable to be created for a project
See merge request !10696
Diffstat (limited to 'app')
-rw-r--r-- | app/services/projects/create_service.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index fbdaa455651..7828c5806b0 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -58,6 +58,9 @@ module Projects fail(error: @project.errors.full_messages.join(', ')) end @project + rescue ActiveRecord::RecordInvalid => e + message = "Unable to save #{e.record.type}: #{e.record.errors.full_messages.join(", ")} " + fail(error: message) rescue => e fail(error: e.message) end |