executeProtectedAsyncResult<S> function

FutureResult<S> executeProtectedAsyncResult<S>(
  1. Future<Result<S>> func()
)

Async version of executeProtectedResult

Implementation

FutureResult<S> executeProtectedAsyncResult<S>(Future<Result<S>> Function() func) async {
  try {
    return await func();
  } catch (e) {
    return Err(Error(e));
  }
}