runTalkerZonedGuarded<R> function
Future<R?>
runTalkerZonedGuarded<R>(
- Talker talker,
- R body(),
- void onError(
- Object error,
- StackTrace stack
- Map<
Object?, Object?> ? zoneValues, - ZoneSpecification? zoneSpecification,
- bool catchFlutterErrors = true,
Implementation
Future<R?> runTalkerZonedGuarded<R>(Talker talker, R Function() body,
void Function(Object error, StackTrace stack) onError,
{Map<Object?, Object?>? zoneValues,
ZoneSpecification? zoneSpecification,
bool catchFlutterErrors = true}) async {
setupErrorHooks(talker, catchFlutterErrors: catchFlutterErrors);
return runZonedGuarded<R>(body, (dynamic error, StackTrace stackTrace) {
onError(error, stackTrace);
talker.handle(error, stackTrace);
}, zoneValues: zoneValues, zoneSpecification: zoneSpecification);
}