mapWait<R> method
Implementation
Future<ResourceTry<R>> mapWait<R>(
Future<R> Function(SuccessT value) transform) async {
try {
return ResourceTry.success((await transform(getOrThrow())));
} on Exception catch (e) {
return ResourceTry.failure(ResourceException.wrap(e));
} on OutOfMemoryError catch (e) {
// We don't want to catch any Error, only OOM.
return ResourceTry.failure(ResourceException.wrap(e));
}
}