diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-03 12:11:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-03 12:11:16 +0000 |
commit | b5820a6bcd083c878a085aa288757e8dc2d35fec (patch) | |
tree | 7ce498ba4cc77c160a04eae2b8fba7474d1196d7 /app/controllers/application_controller.rb | |
parent | 74780f24f2005d24a0e0a8fa1b3ae5391ae2928f (diff) | |
download | gitlab-ce-b5820a6bcd083c878a085aa288757e8dc2d35fec.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5f14d95ffed..379da90827a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,7 +29,6 @@ class ApplicationController < ActionController::Base before_action :validate_user_service_ticket! before_action :check_password_expiration, if: :html_request? before_action :ldap_security_check - around_action :sentry_context before_action :default_headers before_action :default_cache_headers before_action :add_gon_variables, if: :html_request? @@ -171,7 +170,12 @@ class ApplicationController < ActionController::Base end def log_exception(exception) - Gitlab::ErrorTracking.track_exception(exception) + # At this point, the controller already exits set_current_context around + # block. To maintain the context while handling error exception, we need to + # set the context again + set_current_context do + Gitlab::ErrorTracking.track_exception(exception) + end backtrace_cleaner = request.env["action_dispatch.backtrace_cleaner"] application_trace = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, exception).application_trace @@ -528,10 +532,6 @@ class ApplicationController < ActionController::Base .execute end - def sentry_context(&block) - Gitlab::ErrorTracking.with_context(current_user, &block) - end - def allow_gitaly_ref_name_caching ::Gitlab::GitalyClient.allow_ref_name_caching do yield |