diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 21:09:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 21:09:46 +0000 |
commit | 8a7aaf86831d2a556578ae558a4fcab8bb659b20 (patch) | |
tree | 61c2b55aa48ff8e853e546cd3009dfc5423279c8 /app/services/snippets | |
parent | 967812838c7e7742729a4c7aeb9859f98a509622 (diff) | |
download | gitlab-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.rb | 1 | ||||
-rw-r--r-- | app/services/snippets/update_service.rb | 3 |
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 |