diff options
Diffstat (limited to 'app/services/snippets')
-rw-r--r-- | app/services/snippets/bulk_destroy_service.rb | 2 | ||||
-rw-r--r-- | app/services/snippets/create_service.rb | 2 | ||||
-rw-r--r-- | app/services/snippets/destroy_service.rb | 4 | ||||
-rw-r--r-- | app/services/snippets/update_service.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/app/services/snippets/bulk_destroy_service.rb b/app/services/snippets/bulk_destroy_service.rb index a612d8f8dfc..430e8330b59 100644 --- a/app/services/snippets/bulk_destroy_service.rb +++ b/app/services/snippets/bulk_destroy_service.rb @@ -27,7 +27,7 @@ module Snippets rescue DeleteRepositoryError attempt_rollback_repositories service_response_error('Failed to delete snippet repositories.', 400) - rescue + rescue StandardError # In case the delete operation fails attempt_rollback_repositories service_response_error('Failed to remove snippets.', 400) diff --git a/app/services/snippets/create_service.rb b/app/services/snippets/create_service.rb index c95b459cd2a..aadf9b865b8 100644 --- a/app/services/snippets/create_service.rb +++ b/app/services/snippets/create_service.rb @@ -69,7 +69,7 @@ module Snippets end snippet_saved - rescue => e # Rescuing all because we can receive Creation exceptions, GRPC exceptions, Git exceptions, ... + rescue StandardError => e # Rescuing all because we can receive Creation exceptions, GRPC exceptions, Git exceptions, ... Gitlab::ErrorTracking.log_exception(e, service: 'Snippets::CreateService') # If the commit action failed we need to remove the repository if exists diff --git a/app/services/snippets/destroy_service.rb b/app/services/snippets/destroy_service.rb index f1f80dbaf86..96157434462 100644 --- a/app/services/snippets/destroy_service.rb +++ b/app/services/snippets/destroy_service.rb @@ -30,7 +30,7 @@ module Snippets ServiceResponse.success(message: 'Snippet was deleted.') rescue DestroyError service_response_error('Failed to remove snippet repository.', 400) - rescue + rescue StandardError attempt_rollback_repository service_response_error('Failed to remove snippet.', 400) end @@ -59,4 +59,4 @@ module Snippets end end -Snippets::DestroyService.prepend_if_ee('EE::Snippets::DestroyService') +Snippets::DestroyService.prepend_mod_with('Snippets::DestroyService') diff --git a/app/services/snippets/update_service.rb b/app/services/snippets/update_service.rb index aedb6a4819d..4088a08272d 100644 --- a/app/services/snippets/update_service.rb +++ b/app/services/snippets/update_service.rb @@ -78,7 +78,7 @@ module Snippets create_commit(snippet) true - rescue => e + rescue StandardError => e # Restore old attributes but re-assign changes so they're not lost unless snippet.previous_changes.empty? snippet.previous_changes.each { |attr, value| snippet[attr] = value[0] } |