Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/web_hooks/destroy_worker.rb')
-rw-r--r--app/workers/web_hooks/destroy_worker.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/workers/web_hooks/destroy_worker.rb b/app/workers/web_hooks/destroy_worker.rb
index 822a1e770d7..8f9b194f88a 100644
--- a/app/workers/web_hooks/destroy_worker.rb
+++ b/app/workers/web_hooks/destroy_worker.rb
@@ -4,6 +4,8 @@ module WebHooks
class DestroyWorker
include ApplicationWorker
+ DestroyError = Class.new(StandardError)
+
data_consistency :always
sidekiq_options retry: 3
feature_category :integrations
@@ -19,12 +21,7 @@ module WebHooks
result = ::WebHooks::DestroyService.new(user).sync_destroy(hook)
- return result if result[:status] == :success
-
- e = ::WebHooks::DestroyService::DestroyError.new(result[:message])
- Gitlab::ErrorTracking.track_exception(e, web_hook_id: hook.id)
-
- raise e
+ result.track_and_raise_exception(as: DestroyError, web_hook_id: hook.id)
end
end
end