summaryrefslogtreecommitdiff
path: root/app/services/snippets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 21:09:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 21:09:46 +0000
commit8a7aaf86831d2a556578ae558a4fcab8bb659b20 (patch)
tree61c2b55aa48ff8e853e546cd3009dfc5423279c8 /app/services/snippets
parent967812838c7e7742729a4c7aeb9859f98a509622 (diff)
downloadgitlab-ce-8a7aaf86831d2a556578ae558a4fcab8bb659b20.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/snippets')
-rw-r--r--app/services/snippets/create_service.rb1
-rw-r--r--app/services/snippets/update_service.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/app/services/snippets/create_service.rb b/app/services/snippets/create_service.rb
index 9178b929656..389d4819c68 100644
--- a/app/services/snippets/create_service.rb
+++ b/app/services/snippets/create_service.rb
@@ -50,6 +50,7 @@ module Snippets
snippet_saved
rescue => e # Rescuing all because we can receive Creation exceptions, GRPC exceptions, Git exceptions, ...
snippet.errors.add(:base, e.message)
+ log_error(e.message)
# If the commit action failed we need to remove the repository if exists
snippet.repository.remove if snippet.repository_exists?
diff --git a/app/services/snippets/update_service.rb b/app/services/snippets/update_service.rb
index 874357f36cc..76ce8231410 100644
--- a/app/services/snippets/update_service.rb
+++ b/app/services/snippets/update_service.rb
@@ -51,8 +51,9 @@ module Snippets
# the changes
create_commit(snippet) if snippet.repository_exists?
end
- rescue
+ rescue => e
snippet.errors.add(:repository, 'Error updating the snippet')
+ log_error(e.message)
false
end