Catch delete errors

This commit is contained in:
Anton Tananaev 2025-07-05 10:34:41 -07:00
parent 7102d19311
commit d39364376a

View file

@ -46,7 +46,11 @@ class GeolocationService {
static Future<void> onLocation(bg.Location location) async { static Future<void> onLocation(bg.Location location) async {
if (_shouldDelete(location)) { if (_shouldDelete(location)) {
try {
await bg.BackgroundGeolocation.destroyLocation(location.uuid); await bg.BackgroundGeolocation.destroyLocation(location.uuid);
} catch(error) {
developer.log('Failed to delete location', error: error);
}
} else { } else {
LocationCache.set(location); LocationCache.set(location);
try { try {