Skip to content

Commit

Permalink
Fix user tracking error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Sep 18, 2024
1 parent 645960f commit 866484e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/lib/three_scale/analytics/user_tracking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@

module ThreeScale
module Analytics

class UserTrackingError < StandardError
def initialize(status, error)
msg = "User tracking report failed with status: #{status}"
msg << ", message: #{error}" if error
super(msg)
end
end

class UserTracking

error_handler = ->(status, error) do
System::ErrorReporting.report_error(error_message: error, parameters: { status: status })
System::ErrorReporting.report_error(UserTrackingError.new(status, error))
end

class TrackingAdapter
Expand Down

0 comments on commit 866484e

Please sign in to comment.