safer service call
This commit is contained in:
parent
4dd5e9a3b8
commit
85a1ebf8b4
2 changed files with 7 additions and 4 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue