Commit e7c12a3c authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Add user to ApplicationContext

parent 09a03bae
......@@ -181,7 +181,9 @@ module MergeRequests
}
if exception
Gitlab::ErrorTracking.track_exception(exception, data)
Gitlab::ApplicationContext.with_context(user: current_user) do
Gitlab::ErrorTracking.track_exception(exception, data)
end
data[:"exception.message"] = exception.message
end
......
......@@ -467,7 +467,9 @@ module API
def handle_api_exception(exception)
if report_exception?(exception)
define_params_for_grape_middleware
Gitlab::ErrorTracking.track_exception(exception)
Gitlab::ApplicationContext.with_context(user: current_user) do
Gitlab::ErrorTracking.track_exception(exception)
end
end
# This is used with GrapeLogging::Loggers::ExceptionLogger
......
# frozen_string_literal: true
require 'set'
module Gitlab
module ErrorTracking
module Processor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment