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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 14:10:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 14:10:13 +0300
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /app/services/service_response.rb
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'app/services/service_response.rb')
-rw-r--r--app/services/service_response.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/services/service_response.rb b/app/services/service_response.rb
index 6bc394d2ae2..c7ab75a4426 100644
--- a/app/services/service_response.rb
+++ b/app/services/service_response.rb
@@ -18,6 +18,24 @@ class ServiceResponse
self.http_status = http_status
end
+ def track_exception(as: StandardError, **extra_data)
+ if error?
+ e = as.new(message)
+ Gitlab::ErrorTracking.track_exception(e, extra_data)
+ end
+
+ self
+ end
+
+ def track_and_raise_exception(as: StandardError, **extra_data)
+ if error?
+ e = as.new(message)
+ Gitlab::ErrorTracking.track_and_raise_exception(e, extra_data)
+ end
+
+ self
+ end
+
def [](key)
to_h[key]
end