runErrorFuture<T> method
Implementation
Future<T?> runErrorFuture<T>(
Future<T?> future, {
Object? key,
bool throwException = false,
}) async {
try {
return await future;
} catch (e) {
var _key = key ?? typeName;
setErrorFor(_key, e);
onError(_key, e);
if (throwException) rethrow;
return Future.value();
}
}