Catch delete errors
This commit is contained in:
parent
7102d19311
commit
d39364376a
1 changed files with 5 additions and 1 deletions
|
|
@ -46,7 +46,11 @@ class GeolocationService {
|
|||
|
||||
static Future<void> onLocation(bg.Location location) async {
|
||||
if (_shouldDelete(location)) {
|
||||
await bg.BackgroundGeolocation.destroyLocation(location.uuid);
|
||||
try {
|
||||
await bg.BackgroundGeolocation.destroyLocation(location.uuid);
|
||||
} catch(error) {
|
||||
developer.log('Failed to delete location', error: error);
|
||||
}
|
||||
} else {
|
||||
LocationCache.set(location);
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue