runErrorFuture<T> method

Future<T> runErrorFuture<T>(
  1. Future<T> future, {
  2. Object? key,
  3. bool throwException = false,
})
inherited

Implementation

Future<T> runErrorFuture<T>(Future<T> future,
    {Object? key, bool throwException = false}) async {
  try {
    setErrorForModelOrObject(null, key: key);
    return await future;
  } catch (e) {
    setErrorForModelOrObject(e, key: key);
    onFutureError(e, key);
    if (throwException) rethrow;
    return Future.value();
  }
}