summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-13 16:09:17 -0700
committerStan Hu <stanhu@gmail.com>2017-04-13 16:19:25 -0700
commit460fb1fabab8f9afd364055e9d9b212dbb7f8c82 (patch)
tree57880e0b4a557b5762b70cb02bd9627f9ed6dc24 /app
parent7d7dfee48b3455eec07968e7517f9d843a04da66 (diff)
downloadgitlab-ce-460fb1fabab8f9afd364055e9d9b212dbb7f8c82.tar.gz
Improve error messages when a record is unable to be created for a project
Diffstat (limited to 'app')
-rw-r--r--app/services/projects/create_service.rb3
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