summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-28 18:02:23 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2019-01-02 18:59:23 +0100
commit83aa0ea8230018d37f2a0ad562418c3114b6fa81 (patch)
tree1bc1d3cdd80153d454e99ab4b550e35fb6fbbc61 /lib/api/helpers.rb
parent1a83d9387f6db91f2adae5c3d66c6e21077967bc (diff)
downloadgitlab-ce-improve-exception-handling.tar.gz
Refactor Sentry handlingimprove-exception-handling
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 6c1a730935a..f0f8d2b3ce1 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -372,8 +372,9 @@ module API
def handle_api_exception(exception)
if report_exception?(exception)
define_params_for_grape_middleware
- Gitlab::Sentry.context(current_user)
- Gitlab::Sentry.track_acceptable_exception(exception, extra: params)
+ Gitlab::Sentry.in_context(current_user) do
+ Gitlab::Sentry.report_exception(exception, extra: params)
+ end
end
# lifted from https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L60