diff --git a/lib/model/image_entry.dart b/lib/model/image_entry.dart index cb7911923..845dec9dc 100644 --- a/lib/model/image_entry.dart +++ b/lib/model/image_entry.dart @@ -279,8 +279,8 @@ class ImageEntry { locality: address.locality, ); } - } catch (exception) { - debugPrint('$runtimeType addAddressToMetadata failed with path=$path coordinates=$coordinates exception=$exception'); + } catch (exception, stack) { + debugPrint('$runtimeType addAddressToMetadata failed with path=$path coordinates=$coordinates exception=$exception\n$stack'); } } diff --git a/lib/services/service_policy.dart b/lib/services/service_policy.dart index 0fb47929c..a1650ce19 100644 --- a/lib/services/service_policy.dart +++ b/lib/services/service_policy.dart @@ -30,8 +30,11 @@ class ServicePolicy { task ??= _Task( () async { if (debugLabel != null) debugPrint('$runtimeType $debugLabel start'); - final result = await platformCall(); - completer.complete(result); + try { + completer.complete(await platformCall()); + } catch (error, stackTrace) { + completer.completeError(error, stackTrace); + } if (debugLabel != null) debugPrint('$runtimeType $debugLabel completed'); _running = null; _pickNext();