From a26ee230055ca4a91e5f97a399c447f5449cc1c9 Mon Sep 17 00:00:00 2001 From: Daria Mayorova Date: Tue, 30 Jul 2024 17:07:12 +0200 Subject: [PATCH] Fix user tracking error reporting --- app/lib/three_scale/analytics/user_tracking.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/lib/three_scale/analytics/user_tracking.rb b/app/lib/three_scale/analytics/user_tracking.rb index a7924a43e6..60e87932ac 100644 --- a/app/lib/three_scale/analytics/user_tracking.rb +++ b/app/lib/three_scale/analytics/user_tracking.rb @@ -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