From 6cb5463b1358af85e813a2bc612f0a47ac13baba Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Wed, 27 Nov 2019 14:50:53 +0000 Subject: [PATCH] minor background reporting fix --- lib/managers/location_manager.class.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/managers/location_manager.class.dart b/lib/managers/location_manager.class.dart index 663abc5..ef68957 100644 --- a/lib/managers/location_manager.class.dart +++ b/lib/managers/location_manager.class.dart @@ -150,7 +150,7 @@ class LocationManager { void updateDeviceLocationIsolate() { workManager.Workmanager.executeTask((backgroundTask, data) { print("[Background $backgroundTask] Started"); - final SentryClient sentryClient = SentryClient(dsn: "https://5c868e5ef26947e2b61b189e391ec31b@sentry.io/1836366"); + final SentryClient sentryBackgroundClient = SentryClient(dsn: "https://5c868e5ef26947e2b61b189e391ec31b@sentry.io/1836366"); Geolocator geolocator = Geolocator(); var battery = Battery(); int batteryLevel = 100; @@ -187,9 +187,8 @@ void updateDeviceLocationIsolate() { throw "Can't get device location. Location is null"; } }).catchError((e) { - sentryClient.captureException( - exception: "Error tracking location", - stackTrace: "${e.toString()}", + sentryBackgroundClient.captureException( + exception: "${e.toString()}" ); print("[Background $backgroundTask] Error getting current location: ${e.toString()}"); });