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 {
|
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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue