Skip to content

Commit

Permalink
Use global scope for Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Jan 4, 2024
1 parent 5c60c6f commit 1b94ee3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/controllers/concerns/pages_core/error_reporting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ module ErrorReporting
def configure_sentry_scope
return if Rails.env.test? || !Object.const_defined?("Sentry")

Sentry.configure_scope do |scope|
scope.set_context("params", params.to_unsafe_h)
scope.set_tags(locale: params[:locale] || I18n.default_locale.to_s)
scope.set_user(current_user_context)
end
Sentry.set_context("params", params.to_unsafe_h)
Sentry.set_tags(locale: params[:locale] || I18n.default_locale.to_s)
Sentry.set_user(current_user_context)
end

def current_user_context
Expand Down

0 comments on commit 1b94ee3

Please sign in to comment.