tryCatchAsync<T> function
Implementation
Future<T?> tryCatchAsync<T>(FutureOr<T> Function() worker,
[Future<T?> Function(dynamic e)? onError]) async {
try {
return await worker();
} catch (e) {
return onError?.call(e);
}
}