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>2023-01-17 18:07:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-17 18:07:22 +0300
commitd41edc2e93480db35e48ad770ebe95075fbca871 (patch)
tree09d4f5cd1575babf508c73a2653f68b35cd1e936 /lib/gitlab/error_tracking.rb
parentb17a559378235d37f5168d8d18818043cdaaf90b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/error_tracking.rb')
-rw-r--r--lib/gitlab/error_tracking.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/error_tracking.rb b/lib/gitlab/error_tracking.rb
index 582c3380869..876a1cbb183 100644
--- a/lib/gitlab/error_tracking.rb
+++ b/lib/gitlab/error_tracking.rb
@@ -116,6 +116,20 @@ module Gitlab
process_exception(exception, extra: extra, trackers: [Logger])
end
+ # This should be used when you want to log the exception and passthrough
+ # exception handling: rescue and raise to be catched in upper layers of
+ # the application.
+ #
+ # If the exception implements the method `sentry_extra_data` and that method
+ # returns a Hash, then the return value of that method will be merged into
+ # `extra`. Exceptions can use this mechanism to provide structured data
+ # to sentry in addition to their message and back-trace.
+ def log_and_raise_exception(exception, extra = {})
+ process_exception(exception, extra: extra, trackers: [Logger])
+
+ raise exception
+ end
+
private
def before_send_raven(event, hint)