diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 06:06:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 06:06:14 +0300 |
commit | f519cec2ad00c08b03614addd39a0d1a81c5d236 (patch) | |
tree | 59293b4a603c2ac8e20ac94f4a35490f28eb54d0 /lib/gitlab/grape_logging | |
parent | 157f9a451a428f66666ba85d8b880df78aff6cc4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/grape_logging')
-rw-r--r-- | lib/gitlab/grape_logging/loggers/exception_logger.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/gitlab/grape_logging/loggers/exception_logger.rb b/lib/gitlab/grape_logging/loggers/exception_logger.rb index 022eb15d28d..606b7c0dbce 100644 --- a/lib/gitlab/grape_logging/loggers/exception_logger.rb +++ b/lib/gitlab/grape_logging/loggers/exception_logger.rb @@ -11,19 +11,11 @@ module Gitlab # precedence so the logger never sees it. We need to # store and retrieve the exception from the environment. exception = request.env[::API::Helpers::API_EXCEPTION_ENV] + data = {} - return {} unless exception.is_a?(Exception) + return data unless exception.is_a?(Exception) - data = { - exception: { - class: exception.class.to_s, - message: exception.message - } - } - - if exception.backtrace - data[:exception][:backtrace] = Gitlab::Profiler.clean_backtrace(exception.backtrace) - end + Gitlab::ExceptionLogFormatter.format!(exception, data) data end |