Commit 7f5e9645 authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Set application context before handle controller exceptions

parent 6e0b367c
......@@ -170,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
......
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